/* ============================================================
   Modrinth-style theme tokens (dark) — values taken from the
   live modrinth.com project page (computed styles)
   ============================================================ */
:root{
  --surface-1:#16181c;   /* page background */
  --surface-1-5:#1a1c20; /* header */
  --surface-2:#1d1f23;   /* raised card (modal version card) */
  --surface-2-5:#222429;
  --surface-3:#27292e;   /* card / modal background */
  --surface-4:#34363c;   /* button bg, card border */
  --surface-5:#42444a;   /* divider / control border */

  --color-brand:#1bd96a;
  --color-brand-hover:#22e57a;
  --color-brand-highlight:rgba(27,217,106,.25);
  --color-brand-bg:rgba(27,217,106,.1);
  --color-accent-contrast:#000;

  --color-text-primary:#fff;      /* text-contrast */
  --color-text-default:#b0bac5;   /* text-primary  */
  --color-text-tertiary:#96a2b0;  /* text-secondary */

  --button-bg:#34363c;
  --button-bg-hover:#42444a;
  --button-border:#42444a;

  --radius-sm:.5rem; --radius-md:.75rem; --radius-lg:1rem; --radius-xl:1.25rem; --radius-max:9999px;
  --gap-xs:.25rem; --gap-sm:.5rem; --gap-md:.75rem; --gap-lg:1rem; --gap-xl:1.5rem;

  --container:1280px;
  --sidebar:300px;      /* 18.75rem — real .normal-page sidebar */
  --content-max:956px;  /* 59.75rem  */

  --shadow-card:0 2px 4px 0 rgba(0,0,0,.25);
  --shadow-floating:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.1);
  --shadow-button:0 0 0 1px rgba(27,217,106,.3),0 2px 4px rgba(0,0,0,.04),
                  0 5px 8px rgba(0,0,0,.04),0 10px 18px rgba(0,0,0,.03),
                  0 24px 48px rgba(0,0,0,.03);

  --font:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{
  background:var(--surface-1);
  color:var(--color-text-default);
  font-family:var(--font);
  font-size:16px;
  line-height:18.4px;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block}
button{font:inherit;color:inherit;background:none;border:0;margin:0;padding:0;cursor:pointer}
a{color:inherit;text-decoration:none}
h1,h2,h3{color:var(--color-text-primary);margin:0;letter-spacing:normal}
.i{width:1.15em;height:1.15em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.container{width:100%;max-width:var(--container);margin:0 auto;padding:0 1.5rem}

/* ============================================================
   Header — 1280 container, 16/24 padding, 36px items
   ============================================================ */
.site-header{
  background:var(--surface-1);
  border-bottom:1px solid var(--surface-4);
  position:sticky;top:0;z-index:40;
}
.site-header .header-inner{padding:1rem 1.5rem;gap:.5rem}
.header-inner{display:flex;align-items:center}
.brand{display:flex;align-items:center;color:#fff;flex:none}
.brand svg{height:28px;width:156px;transition:transform .1s}
.brand:hover svg{transform:scale(.985)}

.main-nav{display:flex;align-items:center;gap:.5rem;flex:1;margin-left:.5rem}
.nav-item{
  display:flex;align-items:center;gap:6px;
  height:36px;padding:0 10px;border-radius:12px;
  color:var(--color-text-default);
  font-size:16px;font-weight:600;line-height:20px;
  white-space:nowrap;text-align:center;
  transition:background-color .15s,color .15s;
}
.nav-item .i{width:20px;height:20px;color:currentColor}
.nav-item:hover{background:var(--surface-4);color:#fff}
.nav-item.is-raised{background:var(--surface-4);color:#fff}
.nav-item[data-inert]{cursor:default}

.header-right{display:flex;align-items:center;gap:.5rem;margin-left:auto}
.account{
  display:flex;align-items:center;gap:.25rem;
  height:36px;padding:0 .5rem;border-radius:12px;
  color:var(--color-text-tertiary);
}
.account:hover{background:var(--surface-4)}
.account-avatar{
  width:32px;height:32px;border-radius:50%;
  background:var(--surface-4);
  border:1px solid var(--surface-5);
  display:block;
}
.account .i{width:16px;height:16px}

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:36px;padding:0 10px;border-radius:12px;
  font-size:16px;font-weight:600;line-height:20px;
  background:var(--surface-4);color:#fff;
  transition:filter .15s,background-color .15s;
}
.btn:hover{background:var(--button-bg-hover)}
.btn-primary{
  background:var(--color-brand);color:var(--color-accent-contrast);
  box-shadow:var(--shadow-button);
}
.btn-primary:hover{background:var(--color-brand);filter:brightness(1.07)}
.btn-primary:disabled{opacity:.5;cursor:not-allowed;filter:none}
.btn-block{width:100%}
.btn .i{width:20px;height:20px}
.btn-primary .i{stroke-width:2.25}

.icon-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:48px;height:48px;border-radius:50%;
  background:var(--surface-4);color:#fff;
  transition:background-color .15s,filter .15s;
}
.icon-btn:hover{background:var(--button-bg-hover)}
.icon-btn .i{width:24px;height:24px}
.icon-btn.is-on{background:var(--color-brand-highlight);color:var(--color-brand)}

/* ============================================================
   Page grid — header row spans both columns,
   content 1fr (max 956px) + 300px sidebar, 24px gap
   ============================================================ */
.page{
  max-width:var(--container);
  margin:0 auto;
  padding:0 1.5rem 1.5rem;
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--sidebar);
  grid-template-areas:
    "top    top"
    "content sidebar";
  gap:1.5rem;
}

/* ---- project header block ---- */
.project-top{
  grid-area:top;
  margin-top:1rem;
  display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:1rem;
  padding-bottom:1rem;
  border-bottom:1px solid var(--surface-4);
}
.project-id{display:flex;gap:1rem;min-width:0;flex:1 1 auto}
.project-icon{
  width:96px;height:96px;border-radius:16px;
  object-fit:cover;background:var(--surface-4);
  box-shadow:var(--shadow-card);
  flex:none;
}
.project-heading{display:flex;flex-direction:column;justify-content:center;min-width:0;flex:1 1 auto}
.project-heading h1{
  font-size:24px;font-weight:600;line-height:24px;color:#fff;
  margin:0 0 6px;word-break:break-word;
}
.tagline{
  color:var(--color-text-default);
  font-size:16px;font-weight:400;line-height:18.4px;
  margin:0 0 8px;max-width:704px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}

/* metadata row: 16/500 secondary, 26px column gap, dot separators */
.project-meta{display:flex;flex-wrap:wrap;align-items:center;row-gap:8px}
.project-meta > *{margin-right:26px}
.project-meta > *:last-child{margin-right:0}
.project-meta > *:not(:first-child)::before{
  content:"";position:absolute;left:-26px;top:50%;transform:translateY(-50%);
  width:26px;height:6px;
  background:radial-gradient(circle at center,var(--surface-5) 3px,transparent 3.5px);
}
.project-meta > *{position:relative}
.meta{
  display:inline-flex;align-items:center;gap:8px;
  font-size:16px;font-weight:500;line-height:1;
  color:var(--color-text-tertiary);
}
.meta b{color:inherit;font-weight:500}
.meta .i{width:20px;height:20px}
.meta-divider{display:none}

.chips{display:inline-flex;flex-wrap:wrap;gap:8px}
.chip{
  display:inline-flex;align-items:center;gap:4px;
  background:var(--surface-4);color:var(--color-text-tertiary);
  border:1px solid var(--surface-5);
  padding:4px 8px;border-radius:9999px;
  font-size:14px;font-weight:400;line-height:14px;white-space:nowrap;
}
.chip:hover{color:#fff}
.chip .i{width:16px;height:16px;stroke-width:2}

.project-actions{display:flex;align-items:center;gap:.5rem;flex:none}
.project-actions .btn-primary{
  height:48px;padding:0 14px;gap:8px;
  border-radius:16px;
  font-size:16px;font-weight:800;line-height:20px;
}
.project-actions .btn-primary .i{width:24px;height:24px;min-width:24px;min-height:24px}

/* ---- tabs: single pill container ---- */
.content-col{grid-area:content;min-width:0;max-width:var(--content-max)}
.tabs{
  display:inline-flex;width:fit-content;
  background:var(--surface-3);
  border:1px solid var(--surface-4);
  border-radius:9999px;
  padding:4px;
  box-shadow:var(--shadow-card);
  margin-bottom:12px;
}
.tab{
  height:36px;padding:8px 16px;border-radius:9999px;
  display:inline-flex;align-items:center;gap:8px;
  font-size:14px;font-weight:700;line-height:20px;
  color:#fff;
  transition:background-color .1s cubic-bezier(.4,0,.2,1),color .1s cubic-bezier(.4,0,.2,1);
}
.tab:hover{background:rgba(255,255,255,.06)}
.tab.is-active{background:var(--color-brand-highlight);color:var(--color-brand)}
.tab.is-active:hover{background:var(--color-brand-highlight)}

/* ---- cards ---- */
.card{
  background:var(--surface-3);
  border:1px solid var(--surface-4);
  border-radius:16px;
  padding:16px;
  margin-bottom:12px;
  min-height:2rem;
  position:relative;
}
.content-col > .card:last-of-type{margin-bottom:0}
.panel{display:none}
.panel.is-active{display:block;margin-bottom:0}

/* ============================================================
   Prose (description / changelog)
   ============================================================ */
.prose{font-size:16px;font-weight:400;line-height:24px;color:var(--color-text-default)}
.prose h1{
  font-size:32px;font-weight:700;line-height:36.8px;color:#fff;
  margin:0 0 21.44px;padding-bottom:5px;border-bottom:1px solid var(--surface-4);
}
.prose h2{
  font-size:24px;font-weight:700;line-height:27.6px;color:#fff;
  margin:24px 0 8px;padding-bottom:4px;border-bottom:1px solid var(--surface-4);
}
.prose h3{font-size:18.72px;font-weight:700;line-height:21.53px;color:#fff;margin:12px 0 8px}
.prose h4{font-size:16px;font-weight:700;line-height:24px;color:#fff;margin:16px 0 8px}
.prose p{margin:0 0 16px}
.prose ul,.prose ol{margin:0 0 16px;padding-left:40px}
.prose li{margin:0;line-height:24px}
.prose li::marker{color:var(--color-text-tertiary)}
.prose a{color:var(--color-brand)}
.prose a:hover{text-decoration:underline}
.prose strong,.prose b{color:#fff;font-weight:700}
.prose code{
  background:var(--surface-4);border:1px solid var(--surface-5);
  padding:1px 5px;border-radius:4px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;
}
.prose pre{background:var(--surface-4);border:1px solid var(--surface-5);padding:12px;border-radius:8px;overflow:auto}
.prose pre code{background:none;border:0;padding:0}
.prose img{border-radius:8px;margin:16px 0}
.prose blockquote{
  margin:16px 0;padding:12px 16px;border-left:3px solid var(--color-brand);
  background:var(--surface-4);border-radius:0 8px 8px 0;
}
.prose hr{border:0;border-top:1px solid var(--surface-4);margin:16px 0}
.prose > :first-child{margin-top:0}
.prose > :last-child{margin-bottom:0}

/* ============================================================
   Versions tab
   ============================================================ */
.version-row{
  display:flex;align-items:center;gap:1rem;justify-content:space-between;
  padding:16px 0;border-bottom:1px solid var(--surface-4);
}
.version-row:last-child{border-bottom:0;padding-bottom:0}
.version-row:first-child{padding-top:0}
.version-info{display:flex;flex-direction:column;gap:8px;min-width:0}
.version-name{color:#fff;font-weight:600;font-size:16px}
.version-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.version-row .btn{height:36px}
.version-row .meta{font-size:14px}

/* ============================================================
   Sidebar — 300px column, stacked cards (12px margin, 12px gap)
   ============================================================ */
.sidebar{grid-area:sidebar;display:flex;flex-direction:column;min-width:0}
.side-card{
  background:var(--surface-3);
  border:1px solid var(--surface-4);
  border-radius:16px;
  padding:16px;
  margin-bottom:12px;
  display:flex;flex-direction:column;gap:12px;
}
.sidebar > :last-child{margin-bottom:0}
.side-card h3{
  font-size:18px;font-weight:600;line-height:1.5;color:#fff;margin:0;
}
.side-row{display:flex;flex-direction:column;gap:8px}
.side-label{
  display:block;color:var(--color-text-default);
  font-size:16px;font-weight:400;line-height:24px;margin:0;
}
.side-card .chips{gap:4px}
.side-card .chip{padding:4px 8px}

.side-links{display:flex;flex-direction:column;gap:12px}
.side-link{
  display:flex;align-items:center;gap:8px;width:fit-content;
  color:var(--color-text-default);
  font-size:16px;font-weight:600;line-height:1.2;
}
.side-link:hover{text-decoration:underline;color:#fff}
.side-link .i{width:20px;height:20px}
.side-link .ext{display:none}

.creators{display:flex;flex-direction:column}
.creator{display:flex;align-items:center;gap:8px;width:fit-content;padding:2px 0}
.creator + .creator{border-top:1px solid var(--button-border);margin-top:2px;padding-top:6px}
.creator > span:last-child{display:flex;flex-direction:column;min-width:0}
.creator-avatar{
  width:32px;height:32px;border-radius:50%;flex:none;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;color:#000;
}
.creator-name{color:var(--color-text-default);font-weight:500;font-size:16px;line-height:1.2}
.creator-role{display:flex;align-items:center;gap:4px;color:var(--color-text-tertiary);font-size:14px;font-weight:400}
.creator-role .i{width:14px;height:14px}

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop{
  position:fixed;inset:0;z-index:80;
  background:linear-gradient(180deg,rgba(29,48,43,.52) 0,rgba(14,21,26,.95));
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
  display:flex;align-items:center;justify-content:center;
  padding:1rem;
  animation:fade .12s ease-out;
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{
  width:min(544px,100%);
  background:#27292e;
  border:1px solid #42444a;
  border-radius:16px;
  box-shadow:4px 4px 26px 10px rgba(0,0,0,.08),0 24px 60px rgba(0,0,0,.35);
  animation:pop .14s ease-out;
}
@keyframes pop{from{transform:scale(.97);opacity:.4}to{transform:scale(1);opacity:1}}
.modal-head{
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;
  gap:1rem;padding:1.5rem;
  border-bottom:1px solid #42444a;
}
.modal-title-group{display:flex;align-items:center;gap:.75rem;min-width:0}
.modal-icon{
  width:32px;height:32px;border-radius:8px;object-fit:cover;flex:none;
  background:var(--surface-4);border:1px solid var(--surface-5);
}
.modal-head h2{font-size:18px;line-height:1.3;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.modal-head .icon-btn{
  background:#34363c;width:36px;height:36px;border-radius:50%;color:#fff;
}
.modal-head .icon-btn .i{width:20px;height:20px}
.modal-head .icon-btn:hover{filter:brightness(1.15)}
.modal-body{padding:1.5rem;display:flex;flex-direction:column;gap:1rem}
.logo-i{width:1.125rem;height:1.125rem;fill:currentColor;stroke:none}

/* install button — 12px radius, 40px tall, black text on green */
#installApp{
  width:fit-content;align-self:center;
  min-height:40px;padding:8px 12px;gap:6px;
  border-radius:12px;
  font-size:16px;font-weight:600;
}

.or{display:flex;align-items:center;gap:1rem;color:var(--color-text-tertiary);font-size:14px;font-weight:500;margin:0}
.or::before,.or::after{content:"";flex:1;height:2px;border-radius:16px;background:var(--surface-4)}
.or span{white-space:nowrap}

.select{position:relative}
.select-row{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
@media (max-width:520px){.select-row{grid-template-columns:1fr}}
.select-trigger{
  width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  background:var(--surface-4);border:1px solid var(--surface-5);
  border-radius:12px;padding:0 .75rem;
  color:var(--color-text-primary);font-weight:500;font-size:16px;
  transition:background-color .15s,border-color .15s,box-shadow .15s;
}
.select.is-open .select-trigger{border-color:var(--color-brand);box-shadow:0 0 0 4px var(--color-brand-highlight)}
.select-trigger .i{width:20px;height:20px;color:var(--color-text-tertiary);transition:transform .15s}
.select.is-open .select-trigger .i{transform:rotate(180deg)}
.select-value.is-placeholder{color:var(--color-text-tertiary);font-weight:500}
.select.is-locked .select-trigger{border-color:transparent;font-weight:600;cursor:not-allowed}
.select-menu{
  position:absolute;top:calc(100% + .375rem);left:0;right:0;z-index:10;
  background:var(--surface-4);border:1px solid var(--surface-5);
  border-radius:12px;
  box-shadow:0 25px 50px -12px rgba(0,0,0,.25);
  padding:0;max-height:15rem;overflow:auto;
}
.select-option{
  width:100%;height:44px;display:flex;align-items:center;
  text-align:left;padding:4px 16px;border-radius:0;
  color:#fff;font-weight:400;font-size:16px;
}
.select-option:hover{background:var(--surface-5)}
.select-option.is-selected{background:var(--color-brand-highlight);color:var(--color-brand);font-weight:600}

/* version card shown once a game version is picked */
.dl-card{
  display:grid;grid-template-columns:minmax(0,1fr) min-content;align-items:center;gap:.75rem;
  background:var(--surface-2);border:1px solid transparent;border-radius:16px;padding:12px;
}
.dl-info{display:flex;flex-direction:column;gap:.25rem;min-width:0}
.dl-name-row{display:flex;align-items:center;gap:.5rem;min-width:0}
.dl-name{
  color:#fff;font-weight:600;font-size:16px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;
}
.dl-name:hover{text-decoration:underline}
.pill{
  flex:none;background:var(--color-brand-bg);color:var(--color-brand);
  border:1px solid rgba(27,217,106,.3);border-radius:9999px;
  font-size:12px;line-height:1;padding:5px 8px;white-space:nowrap;font-weight:500;
}
.dl-sub{display:flex;align-items:center;gap:6px;font-size:14px;color:var(--color-text-tertiary)}
.dl-sub .dot{width:6px;height:6px;border-radius:50%;background:var(--surface-5);flex:none}
.dl-sub span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dl-button{
  height:36px;padding:0 12px;border-radius:12px;
  background:var(--color-brand);color:var(--color-accent-contrast);
  font-size:16px;font-weight:600;white-space:nowrap;
  display:inline-flex;align-items:center;justify-content:center;
}
.dl-button:hover{filter:brightness(1.07)}

/* ============================================================
   Editor
   ============================================================ */
.edit-fab{
  position:fixed;left:1.25rem;bottom:1.25rem;z-index:60;
  display:flex;align-items:center;gap:.5rem;
  background:var(--surface-3);border:1px solid var(--surface-5);
  color:#fff;font-weight:700;font-size:.875rem;
  padding:.625rem .875rem;border-radius:9999px;
  box-shadow:var(--shadow-floating);
}
.edit-fab:hover{background:var(--surface-4)}
.edit-fab .i{color:var(--color-brand)}

.editor{
  position:fixed;top:0;right:0;bottom:0;width:min(460px,100%);z-index:90;
  background:var(--surface-1);border-left:1px solid var(--surface-5);
  display:flex;flex-direction:column;
  box-shadow:-8px 0 30px rgba(0,0,0,.45);
}
.editor-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.25rem 1.25rem 1rem;border-bottom:1px solid var(--surface-5)}
.editor-head h2{font-size:1.125rem;font-weight:800}
.editor-head .icon-btn{background:var(--surface-3);width:36px;height:36px}
.editor-head .icon-btn .i{width:20px;height:20px}
.editor-body{flex:1;overflow-y:auto;padding:1.25rem;display:flex;flex-direction:column;gap:1.125rem}
.editor-foot{display:flex;gap:.5rem;padding:1rem 1.25rem;border-top:1px solid var(--surface-5);flex-wrap:wrap}
.editor-foot .btn{font-size:.875rem;padding:0 .75rem;height:32px}

.field{display:flex;flex-direction:column;gap:.4rem}
.field label{font-size:.75rem;font-weight:700;color:var(--color-text-tertiary);text-transform:uppercase;letter-spacing:.04em}
.field input,.field textarea{
  width:100%;background:var(--surface-3);border:1px solid var(--surface-5);
  border-radius:12px;color:#fff;
  padding:.6rem .75rem;font:inherit;font-size:.9375rem;resize:vertical;
}
.field input:focus,.field textarea:focus{outline:none;border-color:var(--color-brand);box-shadow:0 0 0 4px var(--color-brand-highlight)}
.field textarea{min-height:7rem;line-height:1.5}
.field textarea.is-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem;min-height:11rem}
.field .hint{font-size:.75rem;color:var(--color-text-tertiary)}
.editor-section{font-size:.75rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--color-brand);border-top:1px solid var(--surface-5);padding-top:1rem}

/* ============================================================
   Toast
   ============================================================ */
.toast{
  position:fixed;left:50%;bottom:2rem;transform:translateX(-50%);z-index:120;
  background:var(--surface-3);border:1px solid var(--surface-5);
  color:#fff;font-weight:600;font-size:.9375rem;
  padding:.7rem 1.1rem;border-radius:12px;
  box-shadow:var(--shadow-floating);
  animation:toastin .15s ease-out;
}
@keyframes toastin{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ============================================================
   Responsive — below 1024px the sidebar stacks under content
   ============================================================ */
@media (max-width:1023px){
  .page{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"top" "content" "sidebar";
  }
  .content-col{max-width:none}
}
@media (max-width:767px){
  .main-nav{display:none}
  .site-header .header-inner{padding:.75rem 1rem}
  .project-top{flex-direction:column;gap:1rem}
  .project-actions{width:100%}
  .project-actions .btn-primary{flex:1}
  .project-icon{width:72px;height:72px}
  .project-heading h1{font-size:20px;line-height:24px}
  .card{padding:12px}
  .prose h1{font-size:24px;line-height:28px}
  .page{padding:0 1rem 1.5rem}
}
