:root{
  --bg: #0b1220;
  --panel: #0f1b2e;
  --panel2: #0c1728;
  --border: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --accent: #f7c948;
  --accent2: #ffd86b;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
}

[data-theme="light"]{
  --bg: #fafbfc;
  --panel: #ffffff;
  --panel2: #f5f7fa;
  --border: rgba(0,0,0,.06);
  --text: #1a1a1a;
  --muted: #555;
  --accent: #f7c948;
  --accent2: #e6b800;
  --shadow: 0 6px 20px rgba(0,0,0,.06);
}

[data-theme="light"] body{
  background: radial-gradient(1200px 600px at 20% 0%, rgba(255,201,72,.06), transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(200,220,255,.08), transparent 55%),
              linear-gradient(135deg, #fafbfc 0%, #f5f7fa 50%, #f0f2f5 100%);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  transition: background .3s ease, color .3s ease;
}

[data-theme="dark"] body{
  background: radial-gradient(1200px 600px at 20% 0%, rgba(255,201,72,.10), transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(84,138,255,.12), transparent 55%),
              var(--bg);
}

.container{ width:min(1100px, 92vw); margin: 22px auto 40px; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  transition: background .3s ease;
}

[data-theme="dark"] .topbar{
  background: rgba(11,18,32,.72);
}

.brand{ 
  display:flex; 
  align-items:center; 
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.logo{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,201,72,.22), rgba(255,201,72,.06));
  border: 1px solid rgba(255,201,72,.35);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.logo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brandTitle{ font-weight: 800; }
.brandSubtitle{ color: var(--muted); font-size: 13px; margin-top: 2px; }

.tabs{ display:flex; gap: 8px; flex-wrap: wrap; justify-content:flex-end; }
.tab{
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  cursor:pointer;
  transition: transform .08s ease, border-color .2s ease, background .2s ease;
}

.tab:hover{ transform: translateY(-1px); border-color: var(--muted); }
.tab.is-active{
  border-color: rgba(255,201,72,.55);
  background: rgba(255,201,72,.10);
  color: var(--accent2);
}

.hero{
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero h1{ margin: 0 0 8px; font-size: 24px; }
.hero p{ margin: 0; color: var(--muted); }

.heroMeta{ display:flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel2);
  cursor: pointer;
  transition: all .2s ease;
}

.pill:hover{
  border-color: var(--accent);
}

.pill-accent{ 
  border-color: rgba(255,201,72,.55); 
  color: var(--text); 
  background: rgba(255,201,72,.25); 
  font-weight: 600;
}

.gridHeader{
  margin-top: 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.gridHeader h2{ margin: 0; font-size: 16px; color: var(--muted); font-weight: 700; }
.searchBox input{
  width: min(320px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease;
}

.searchBox input:focus{ border-color: rgba(255,201,72,.55); }

.grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.card{
  grid-column: span 12;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card:hover{
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 18px 45px rgba(0,0,0,.15);
  border-color: rgba(255,201,72,.40);
}

@media (min-width: 820px){
  .card{ grid-column: span 6; }
}

.cardIcon{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,201,72,.1);
  border: 1px solid rgba(255,201,72,.3);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  overflow: hidden;
}

.cardIcon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cardTop{ display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; flex: 1; }
.card h3{ margin:0; font-size: 18px; }
.badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel2);
  white-space:nowrap;
}

.badge.plugin{ border-color: rgba(84,138,255,.35); color: rgba(84,138,255,.95); }
.badge.addon{ border-color: rgba(132,255,191,.38); color: rgba(50,180,120,.95); }
.badge.model3d{ border-color: rgba(255,201,72,.45); color: var(--accent2); background: rgba(255,201,72,.08); }

[data-theme="dark"] .badge.plugin{ color: rgba(170,205,255,.95); }
[data-theme="dark"] .badge.addon{ color: rgba(180,255,220,.95); }

.desc{ margin: 8px 0 0; color: var(--muted); }

.cardFooter{
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--accent2);
  font-weight: 500;
}

.block{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel2);
  overflow:hidden;
}

.blockHeader{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.blockBody{ padding: 10px 12px; color: var(--text); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.footer{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display:flex;
  justify-content:space-between;
  color: var(--muted);
}

.footer a{ color: var(--accent2); text-decoration:none; }
.footer a:hover{ text-decoration: underline; }

/* MODAL */
.modal{
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.is-open{
  display: flex;
}

.modalContent{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,.5);
  position: relative;
}

.modalClose{
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  display: grid;
  place-items: center;
  transition: background .2s ease;
}

.modalClose:hover{
  background: var(--border);
}

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

.modalTitleGroup{
  display: flex;
  align-items: center;
  gap: 12px;
}

.modalIcon{
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255,201,72,.3);
}

.modalDesc{
  color: var(--muted);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

@media (max-width: 560px){
  .topbar{ padding: 12px 12px; }
  .brandTitle{ font-size: 14px; }
  .brandSubtitle{ font-size: 12px; }

  .tabs{ justify-content: flex-start; gap: 6px; }
  .tab{ padding: 8px 10px; border-radius: 12px; }

  .searchBox input{ width: 100%; }
  .gridHeader{ flex-direction: column; align-items: stretch; }

  .modalContent{
    width: 95%;
    padding: 18px;
  }
}
