@font-face {
  font-family: 'Minecraft Regular';
  src: url('fonts/MinecraftRegular-Bmg3.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

body {
  margin: 0;
  font-family: 'Minecraft Regular', sans-serif;
  background-color: #000000;
  background-image: var(--site-bg-image);
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #ecf0ff;
  overflow-x: hidden;
}

:root {
  --ui-gap: 12px;
  --site-bg-image: none;
}

/* Feed */
.home-content {
  width: 100%;
}

.feed-section {
  width: 100%;
  box-sizing: border-box;
}

.feed-title {
  font-size: 1.1rem;
  font-family: 'Minecraft Regular', sans-serif;
  color: #ecf0ff;
  margin: 0 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--ui-gap);
}

.feed-loading, .feed-empty {
  color: rgba(236,240,255,0.55);
  font-size: 0.9rem;
  padding: 12px 0;
}

.feed-empty.error { color: #ff7070; }

.feed-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-card-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feed-card-logo {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.feed-card-logo-placeholder {
  background: rgba(255,255,255,0.08);
}

.feed-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.feed-project-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #8fb0ff;
  text-decoration: underline;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-project-name:hover { color: #b8d0ff; }

.feed-date {
  font-size: 0.78rem;
  color: rgba(236,240,255,0.5);
}

.feed-file-name {
  font-size: 0.8rem;
  color: rgba(236,240,255,0.7);
  word-break: break-all;
}

.feed-card-actions {
  display: flex;
  gap: 8px;
}

.feed-changelog-btn {
  flex: 1;
  background: rgba(176,0,0,0.3);
  border: 1px solid #B00000;
  color: #ecf0ff;
  font-family: 'Minecraft Regular', sans-serif;
  font-size: 0.82rem;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.feed-changelog-btn:hover {
  background: rgba(176,0,0,0.55);
}

.feed-file-link-btn {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ecf0ff;
  font-family: 'Minecraft Regular', sans-serif;
  font-size: 0.82rem;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  text-align: center;
  display: block;
}

.feed-file-link-btn:hover {
  background: rgba(255,255,255,0.13);
}

/* Changelog Modal */
.changelog-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

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

.changelog-modal-box {
  background: #0e1117;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  width: min(1000px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  cursor: default;
  overflow: hidden;
}

.changelog-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.changelog-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ecf0ff;
}

.changelog-close-btn {
  background: none;
  border: none;
  color: rgba(236,240,255,0.6);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.changelog-close-btn:hover { color: #ecf0ff; }

.changelog-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  color: rgba(236,240,255,0.85);
  font-size: 0.88rem;
  line-height: 1.6;
}

.page-hero {
  padding: 34px clamp(18px, 4vw, 52px);
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(176,0,0,0.22), rgba(14,17,23,0.9));
}
.page-hero h1 { margin: 5px 0 12px; font-size: clamp(1.55rem, 4vw, 2.7rem); line-height: 1.15; }
.page-hero p:last-child { max-width: 780px; margin-bottom: 0; color: rgba(236,240,255,0.72); line-height: 1.7; }
.eyebrow { color: #ff6666; font-size: 0.72rem; letter-spacing: 0.14em; margin: 0; }
.simple-page-title { margin-bottom: var(--ui-gap); padding: 18px 20px; border-left: 3px solid #b00000; background: rgba(255,255,255,0.04); }
.simple-page-title h1 { margin: 0; font-size: 1.35rem; }
.content-stack { display: grid; gap: var(--ui-gap); }
.content-panel, .feature-card, .news-card, .link-card, .project-card, .faq-list details, .status-row {
  box-sizing: border-box; background: rgba(14,17,23,0.9); border: 1px solid rgba(255,255,255,0.11); border-radius: 8px;
}
.content-panel, .news-card { padding: 22px; }
.content-panel h2, .news-card h2, .feature-card h3 { margin-top: 0; }
.content-panel p, .news-card p, .feature-card p { color: rgba(236,240,255,0.72); line-height: 1.7; }
.feature-grid, .link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--ui-gap); margin-bottom: var(--ui-gap); }
.feature-card { padding: 20px; }
.feature-card a { color: #ff7777; }
.link-card { padding: 22px; color: #ecf0ff; text-decoration: none; transition: transform .15s, border-color .15s; }
.link-card:hover { transform: translateY(-2px); border-color: #b00000; }
.link-card strong, .link-card span { display: block; }
.link-card strong { color: #ff7777; margin-bottom: 8px; }
.link-card span { color: rgba(236,240,255,0.65); line-height: 1.5; }
.project-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--ui-gap); }
.project-card { display: flex; gap: 15px; padding: 16px; }
.project-card img { width: 82px; height: 82px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.project-card h2 { margin: 0 0 7px; font-size: 1rem; }
.project-card p { margin: 0 0 7px; color: rgba(236,240,255,0.7); word-break: break-word; }
.project-card time, .news-card time { color: rgba(236,240,255,0.45); font-size: .76rem; }
.project-actions { display: flex; gap: 12px; margin-top: 12px; }
.project-actions a { color: #ff7777; font-size: .8rem; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { padding: 16px 18px; }
.faq-list summary { cursor: pointer; color: #ecf0ff; }
.faq-list p { color: rgba(236,240,255,0.7); line-height: 1.65; }
.status-list { display: grid; gap: 10px; }
.status-row { display: flex; justify-content: space-between; gap: 20px; padding: 17px 20px; }
.status-ok { color: #6de38b; }.status-error { color: #ff7070; }
.news-card time { color: #ff7777; }
.news-card a { color: #ff7777; }
.news-body { color: rgba(236,240,255,0.78); line-height: 1.7; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.news-preview-section { margin-bottom: 28px; }
.news-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ui-gap); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 14px; padding-bottom: 8px; }
.section-heading h2 { margin: 0; font-size: 1.1rem; }
.section-heading a { color: #ff7777; font-size: .8rem; }
.about-copy p { margin: 0 0 18px; }
.about-copy p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .project-library { grid-template-columns: 1fr; }
  .project-card { align-items: flex-start; }
  .page-hero { padding: 24px 18px; }
  .news-preview-grid { grid-template-columns: 1fr; }
}

.changelog-modal-body img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.changelog-modal-body ul { padding-left: 20px; margin: 6px 0; }
.changelog-modal-body li { margin-bottom: 4px; }
.changelog-modal-body h1,
.changelog-modal-body h2,
.changelog-modal-body h3 { color: #ecf0ff; margin-top: 10px; margin-bottom: 4px; }

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}
.lightbox-overlay.open {
  display: flex;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
  cursor: default;
  pointer-events: none;
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 10px 24px;
  color: rgba(236,240,255,0.65);
  font-size: 0.82rem;
  border-top: 1px solid rgba(255,255,255,.08);
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: rgba(236,240,255,0.9);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.page-layout {
  display: none;
}

main.main-layout {
  display: flex;
  flex-direction: column;
  max-width: 1300px;
  margin: 40px auto;
  padding: 24px;
  background: #070707;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 0;
  box-sizing: border-box;
  gap: 0;
}

.logo-header {
  width: 100%;
  margin-bottom: 0;
}

.site-nav {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 18px;
  box-sizing: border-box;
}

.nav-link {
  display: inline-block;
  padding: 8px 22px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #b0bfe8;
  text-decoration: none;
  font-family: 'Minecraft Regular', sans-serif;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #ecf0ff;
  border-color: rgba(255,255,255,0.25);
}

.nav-link.active {
  background: rgba(176, 0, 0, 0.35);
  border-color: #B00000;
  color: #ffffff;
}

.top-wide {
  width: 100%;
  margin-bottom: var(--ui-gap);
}

.top-wide p {
  margin-top: 0;
  margin-bottom: 16px;
}

.logo {
  width: auto;
  max-width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.main-body {
  display: flex;
  align-items: flex-start;
  gap: var(--ui-gap);
}

.main-content {
  flex: 1;
  min-width: 0;
}

.preview-panel {
  width: 340px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  padding: 20px;
  align-self: flex-start;
  box-sizing: border-box;
  margin-top: 0;
  min-height: 760px;
}

.preview-panel-title {
  margin: 0 0 var(--ui-gap);
  font-size: 1.05rem;
  color: #ecf0ff;
}

.preview-banner-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(95,141,255,0.2), rgba(255,255,255,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--ui-gap);
}

.preview-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.preview-banner-initials {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  display: none;
}

.preview-info-panel {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.65);
  padding: 10px;
  min-height: 170px;
}

.preview-info-title {
  font-size: 0.78rem;
  color: rgba(236,240,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.preview-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 10px;
  min-height: 1.35em;
  color: #ecf0ff;
}

.preview-desc {
  font-size: 0.88rem;
  color: rgba(236,240,255,0.75);
  line-height: 1.5;
  white-space: pre-line;
  min-height: 7.5em;
  max-height: 13.5em;
  overflow: auto;
}



h1 {
  margin-top: 0;
}

.title-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 140px;
}


.categories {
  display: grid;
  gap: var(--ui-gap);
  margin-bottom: 20px;
}

.category {
  border: 1px solid rgba(255,255,255,.12);
  padding: 0 14px 14px;
  border-radius: 0;
  background: rgba(255,255,255,.04);
}

.category h3 {
  margin: 0;
  color: #ecf0ff;
  font-size: 1.05rem;
  line-height: 1;
  height: 45px;
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
  position: relative;
  padding-right: 26px;
  box-sizing: border-box;
}

.category h3::after {
  content: '▼';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
  font-size: 0.85rem;
  opacity: 0.8;
}

.category.collapsed h3::after {
  transform: translateY(-50%) rotate(-90deg);
}

.category.collapsed {
  height: 45px;
  padding: 0 14px;
  box-sizing: border-box;
}

.category.collapsed h3 {
  margin: 0;
}

.category.collapsed .pack-list {
  display: none;
}

.category:not(.collapsed) .pack-list {
  padding-top: var(--ui-gap);
}

.pack-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pack-item {
  border: 1px solid rgba(255,255,255,.08);
  padding: 16px;
  border-radius: 0;
  background: rgba(255,255,255,.02);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.pack-item:hover {
  transform: translateY(-2px);
}

.pack-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(95,141,255,0.2), rgba(255,255,255,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  flex-grow: 0;
  overflow: hidden;
}

.pack-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pack-item strong {
  display: block;
  font-size: 0.98rem;
}

.pack-name-link {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: #8fb0ff;
  text-decoration: underline;
}

.pack-name-link:hover {
  color: #b9ccff;
}

.pack-item span {
  display: none;
}

.global-tooltip {
  position: absolute;
  background: #000000;
  border: 1px solid #B00000;
  color: #ecf0ff;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 8px 10px;
  z-index: 99999;
  pointer-events: none;
  box-sizing: border-box;
}

.pack-item:hover {
  border-color: rgba(144, 238, 144, 0.4);
}

.pack-item.selected {
  background: rgba(144, 238, 144, 0.16);
  border-color: rgba(144, 238, 144, 0.5);
}

.pack-item strong {
  display: block;
  font-size: 1rem;
}

.pack-item span {
  display: block;
  opacity: .85;
  margin-top: 6px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.meta-input {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.meta-input-in-preview {
  margin-top: var(--ui-gap);
}

.meta-input label {
  font-weight: bold;
}

.meta-input input {
  width: 100%;
  height: 45px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
  background: rgba(255,255,255,.05);
  color: #ecf0ff;
  box-sizing: border-box;
}

.meta-input input::placeholder {
  color: rgba(255,255,255,.5);
}

.meta-input .hint {
  margin: 0;
  opacity: .8;
  font-size: .92rem;
}

.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}

.actions-in-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: var(--ui-gap);
  margin-bottom: 0;
}

.actions-in-preview #download-btn {
  grid-column: 1 / -1;
}

.download-summary-panel {
  margin-top: var(--ui-gap);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.55);
  padding: 10px;
}

.created-file-name {
  font-size: 0.9rem;
  color: #ecf0ff;
  margin-bottom: 10px;
  word-break: break-all;
}

.selected-list-title {
  margin-top: 4px;
}

.selected-options-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: rgba(236,240,255,0.85);
  font-size: 0.86rem;
  line-height: 1.45;
  max-height: 180px;
  overflow: auto;
}

.actions button {
  padding: 8px 12px;
  background: #5f8dff;
  border: none;
  border-radius: 0;
  color: white;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
}

.actions button:hover {
  background: #4a76e0;
}

.actions button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

#download-btn {
  background: #28a745;
}

#download-btn:hover {
  background: #218838;
}

#select-all {
  background: #28a745;
}

#select-all:hover {
  background: #218838;
}

#select-none {
  background: #B00000;
}

#select-none:hover {
  background: #8f0000;
}

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 0;
  background: rgba(255,255,255,.08);
}

@media (max-width: 1200px) {
  .pack-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .pack-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .pack-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .pack-list {
    grid-template-columns: 1fr;
  }
}

.message.error {
  background: rgba(255,80,80,.14);
  color: #ffb3b3;
}
