[hidden] {
  display: none !important;
}

:root {
  --brand: #5EFF0D;
  --brand-hover: #0050FF;
  --brand-ink: #0A141E;
  --brand-bg: rgb(94 255 13 / 0.12);
  --brand-border: rgb(94 255 13 / 0.35);
  --radius-panel: 0;
  --radius-md: 0;
  --radius-sm: 0;
  --radius-xs: 0;
  --notch: none;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-bar {
  width: 100%;
  max-width: calc(1200px + var(--host-rail-w, 0px));
  margin: 0 auto;
  padding-inline: var(--page-padding);
}

main.app-bar {
  padding-block: var(--sp-8) clamp(40px, 6vw, 64px);
  flex: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgb(10 20 30 / 0.9), transparent);
}

.topbar-brand {
  display: flex;
  align-items: flex-end;
  text-decoration: none;
}

.topbar-brand img {
  height: 48px;
  width: auto;
  display: block;
  transition: transform 0.3s, filter 0.3s;
}

.topbar-brand:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));
}

.topbar-title {
  padding-left: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 20px;
  color: var(--text);
  transition: color 0.3s;
}

.topbar-brand:hover .topbar-title {
  color: var(--brand);
}

.topbar-links,
.topbar-actions {
  display: none;
}

.topbar-links {
  flex: 1;
  justify-content: center;
  gap: 40px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-transform: uppercase;
  filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
}

.topbar-links a,
.mobile-menu-links a {
  color: var(--text);
  text-decoration: none;
}

.topbar-links a:hover,
.mobile-menu-links a:hover {
  color: var(--secondary);
}

.topbar-actions {
  gap: 16px;
}

.topbar-button {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--brand);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.topbar-button:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

.topbar-button-primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.topbar-button-primary:hover {
  background: var(--secondary);
  color: var(--brand-ink);
}

.topbar-menu-button,
.mobile-menu-close {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.topbar-menu-button svg,
.mobile-menu-close svg {
  width: 32px;
  height: 32px;
  display: block;
}

@media (min-width: 1360px) {
  .topbar-links,
  .topbar-actions {
    display: flex;
  }

  .topbar-menu-button {
    display: none;
  }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.75;
}

.mobile-menu-panel {
  position: relative;
  width: 80%;
  height: 100%;
  padding: 24px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 24px;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
}

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}

.site-header {
  height: auto;
  min-height: var(--header-h);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.page-title-link {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.back-link {
  flex: none;
}

.back-link + .page-title-link {
  margin-right: auto;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.page-tagline {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-muted);
}

.button-primary,
.button-primary-outline,
.small-button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid var(--brand);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}

.button-primary,
.small-button-primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.small-button-primary {
  padding: 6px 16px;
  border-width: 1px;
}

.button-primary:hover:not(:disabled),
.small-button-primary:hover:not(:disabled) {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--brand-ink);
}

.button-primary-outline {
  background: transparent;
  color: var(--brand);
}

.button-primary-outline:hover:not(:disabled) {
  border-color: var(--secondary);
  color: var(--secondary);
}

.button-primary:disabled,
.small-button-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }

  .site-header-inner {
    padding-block: 12px;
    flex-wrap: wrap;
  }

  .page-title-link {
    flex-wrap: wrap;
    row-gap: 4px;
  }
}

.card-meta,
.host-card-title,
.mono-label {
  font-family: var(--font-display);
}

.host-card-title {
  text-transform: none;
}

.ribbon {
  background: var(--secondary);
}

.bottom-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 32px 16px;
}

.ribbon h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  color: var(--text);
}

.ribbon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button-secondary,
.button-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 2px solid var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s ease-out;
}

.button-secondary {
  background: var(--text);
  color: var(--secondary);
}

.button-secondary-outline {
  background: transparent;
  color: var(--text);
}

.button-secondary:hover {
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.button-secondary-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

.org-footer {
  background: var(--bg-surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
}

.org-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 32px;
}

.org-footer-grid .topbar-brand {
  grid-column: 1 / -1;
  justify-self: start;
}

.org-footer h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--text);
}

.org-footer ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.org-footer li a {
  color: var(--text-muted);
  text-decoration: none;
}

.org-footer li a:hover,
.org-footer-discord:hover {
  color: var(--secondary);
}

.org-footer-more summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}

.org-footer-more summary::-webkit-details-marker {
  display: none;
}

.org-footer-more summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.org-footer-more[open] summary svg {
  transform: rotate(180deg);
}

.org-footer-more-open,
.org-footer-more[open] .org-footer-more-closed {
  display: none;
}

.org-footer-more[open] .org-footer-more-open {
  display: inline;
}

.org-footer-discord {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand);
}

.org-footer-discord svg {
  display: block;
  width: 40px;
  height: 40px;
}

.org-footer-copy {
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--text-muted);
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .bottom-inner {
    padding-inline: 24px;
  }
}

@media (min-width: 768px) {
  .org-footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .bottom-inner {
    padding: 48px 32px;
  }

  .ribbon .bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 56px;
  }

  .ribbon-actions {
    flex-shrink: 0;
    margin-top: 0;
  }
}

@media (min-width: 1280px) {
  .org-footer-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .org-footer-grid .topbar-brand {
    grid-column: auto;
    align-self: start;
  }

  .org-footer-copy {
    text-align: center;
  }
}


.lede {
  margin-top: var(--sp-3);
}

.item-catalog {
  padding-block: var(--sp-6);
}

.item-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  background: var(--bg-inset);
}

.item-toolbar label {
  display: block;
  margin-bottom: var(--sp-2);
}

.item-toolbar .field {
  width: 100%;
  min-height: 44px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 155px), 1fr));
  gap: var(--sp-3);
  margin: var(--sp-3) 0 0;
  padding: 0;
  list-style: none;
}

.item-card {
  --item-accent: var(--border-strong);
  display: flex;
  height: 100%;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: 2px solid var(--item-accent);
  background: var(--bg-inset);
  color: var(--text);
  text-decoration: none;
}

[data-category="Items"] { --item-accent: #ffca63; }
[data-category="Production"] { --item-accent: #ff9f5a; }
[data-category="Power"] { --item-accent: #79bdff; }
[data-category="Transport"] { --item-accent: #80dc7a; }
[data-category="Vehicles"] { --item-accent: #caa0ff; }

.item-card:hover {
  border-color: var(--item-accent);
  background: var(--bg-surface);
  color: var(--text);
}

.item-card:focus-visible,
.item-detail-section a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.item-art {
  display: grid;
  place-items: center;
  min-height: 106px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--item-accent) 18%, var(--bg)), var(--bg));
}

.item-art img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.item-card-label {
  display: grid;
  flex: 1;
  align-content: start;
  gap: var(--sp-1);
  padding: var(--sp-3);
}

.item-name {
  font: 600 0.9rem/1.35 var(--font-display);
  overflow-wrap: anywhere;
}

.item-type {
  color: var(--item-accent);
  font: 500 0.72rem/1.3 var(--font-mono);
}

.item-meta,
#item-count,
#item-build {
  color: var(--text-muted);
}

.item-meta {
  font-size: 0.78rem;
}

.item-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-block: var(--sp-5);
}

.item-pages button:disabled {
  opacity: 0.5;
}

.item-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: 88dvh;
  padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text);
  box-shadow: var(--shadow-deep);
}

.item-dialog::backdrop {
  background: rgb(5 14 23 / 0.78);
}

body:has(.item-dialog[open]) {
  overflow: hidden;
}

.item-dialog-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

#item-details {
  padding: var(--sp-4);
}

.item-detail-heading {
  --item-accent: var(--border-strong);
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-4);
}

.item-detail-heading .item-art {
  border: 1px solid var(--border);
  border-top: 2px solid var(--item-accent);
}

.item-dialog h2 {
  margin: var(--sp-1) 0;
  font: 700 clamp(1.35rem, 4vw, 2rem)/1.18 var(--font-display);
  overflow-wrap: anywhere;
}

.item-description {
  margin-top: var(--sp-4);
  color: var(--text-muted);
  white-space: pre-line;
}

.item-detail-section {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.item-detail-section h3 {
  margin: 0 0 var(--sp-3);
  font: 600 1rem/1.3 var(--font-display);
}

.item-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-2);
  margin: 0;
}

.item-stats > div {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg);
  overflow-wrap: anywhere;
}

.item-stats dt {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.item-stats dd {
  margin: var(--sp-1) 0 0;
  font-family: var(--font-mono);
}

.item-related {
  margin: 0;
  padding-left: 1.2rem;
}

.item-related li {
  padding-block: var(--sp-1);
}

.item-recipe {
  padding: var(--sp-3);
  background: var(--bg);
}

.item-recipe + .item-recipe {
  margin-top: var(--sp-3);
}

.item-recipe h4 {
  margin: 0 0 var(--sp-1);
  font: 600 0.95rem/1.3 var(--font-display);
}

.item-recipe p {
  margin: 0 0 var(--sp-2);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.item-detail-section a {
  color: var(--brand);
}

.item-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .item-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
  }

  .item-toolbar > :first-child {
    grid-column: 1 / -1;
  }

  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-detail-heading {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .item-detail-heading .item-art {
    min-height: 82px;
  }
}
