@font-face {
  font-family: 'Michroma';
  src: url('../fonts/Michroma-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Animatable angle for the conic-gradient border sweep on icon tiles */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes border-spin {
  to { --border-angle: 360deg; }
}

/* Background lives on html so body::before/::after overlays can sit between
   the image and the page content without z-index fighting body's own bg. */
html {
  background: #0b0f14 url('./../img/featured-games-bg.jpg') center top / cover no-repeat fixed;
}

html, body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Michroma', 'Arial Narrow', sans-serif;
  color: #dfdfdf;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
}

/* Gradient overlay: darkens bottom third to cover the bg cut-off. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(11,15,20,0)       0%,
    rgba(11,15,20,0.2)    45%,
    rgba(11,15,20,0.85)   75%,
    #0b0f14               100%
  );
}

/* Subtle orange radial halo at the top centre. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(224,74,20,0.07), transparent 60%);
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Header */

header {
  width: 100%;
  padding: 10px 24px;
  background: rgba(8, 11, 15, 0.92);
  border-bottom: 1px solid rgba(224, 74, 20, 0.35);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

header img {
  max-width: 200px;
}

h1 {
  font-family: 'Oxanium', 'Orbitron', 'Michroma', sans-serif;
  font-weight: 600;
  margin: 0.2em 0;
  font-size: 2.2em;
  color: #ddd;
}

p {
  font-size: 1.1em;
  margin: 20px auto;
  color: #ddd;
  text-align: center;
  max-width: 900px;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
}

/* Links section */

.links {
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  width: 90%;
  max-width: 900px;
  padding: 20px;
  background: rgba(0,0,0,0.5);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
}

.links a {
  position: relative;
  text-decoration: none;
  color: #e04a14;
  background: linear-gradient(180deg, #261610 0%, #160d08 100%);
  border: 1px solid rgba(224, 74, 20, 0.5);
  box-shadow: inset 0 1px 0 rgba(224,74,20,0.35);
  border-radius: 4px;
  padding: 10px 14px;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.05em;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sweep animation ring — same technique as .icon-item::after */
.links a::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 5px;
  padding: 1.5px;
  background: conic-gradient(from var(--border-angle, 0deg),
    rgba(224,74,20,0)     0deg,
    rgba(224,74,20,0)    55deg,
    #ff6a30              90deg,
    rgba(224,74,20,0)   140deg,
    rgba(224,74,20,0)   360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.links a:hover,
.links a:focus-visible {
  background: linear-gradient(180deg, #3a1e0e 0%, #221208 100%);
  color: #ff6a30;
  border-color: rgba(255, 106, 48, 0.7);
  box-shadow: inset 0 1px 0 rgba(255,106,48,0.5), 0 0 10px rgba(224, 74, 20, 0.3);
}

.links a:hover::after,
.links a:focus-visible::after {
  opacity: 1;
  animation: border-spin 3s linear infinite;
}

/* Discord button */

.discord {
  margin: 30px 0;
}

.discord a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  background-color: #5865F2;
  padding: 12px 15px;
  border-radius: 5px;
  transition: background-color 0.2s ease;
}

.discord a:hover {
  background-color: #4752c4;
}

.discord-icon {
filter: brightness(1000%);
  width: 30px;
  height: 30px;
}

/* Icon grid */

.icons-grid {
  --tile-base: 76px;
  --tile-scale: 1;
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, calc(var(--tile-base) * var(--tile-scale)));
  gap: 15px;
  justify-content: center;
  padding: 20px;
  max-width: 100%;
  position: relative;
  margin: auto;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  align-content: flex-start;
}

.icons-grid[data-preview-size="small"] { --tile-scale: 0.6; }
.icons-grid[data-preview-size="medium"] { --tile-scale: 1; }
.icons-grid[data-preview-size="large"] { --tile-scale: 1.6; }

.portraits-grid {
  --tile-base: 100px;
}

article {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
  text-align: center;
  padding: 10px;
}

/* Icon items */

.icon-item {
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 4px;
  background: #12181f;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  width: calc(var(--tile-base, 76px) * var(--tile-scale, 1));
  height: calc(var(--tile-base, 76px) * var(--tile-scale, 1));
}

.icon-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(224, 74, 20, 0.55);
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Animated sweep ring — shown on hover/focus/active */
.icon-item::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 5px;
  padding: 1.5px;
  background: conic-gradient(from var(--border-angle, 0deg),
    rgba(224,74,20,0)     0deg,
    rgba(224,74,20,0)    55deg,
    #ff6a30              90deg,
    rgba(224,74,20,0)   140deg,
    rgba(224,74,20,0)   360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.icon-item:hover::before,
.icon-item:has(a:focus-visible)::before,
.icon-item:has(a:active)::before {
  border-color: rgba(224, 74, 20, 0.85);
  box-shadow: 0 0 10px rgba(224,74,20,0.35);
}

.icon-item:hover::after,
.icon-item:has(a:focus-visible)::after,
.icon-item:has(a:active)::after {
  opacity: 1;
  animation: border-spin 3s linear infinite;
}

.icon-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  transition: opacity 0.3s ease-in;
  cursor: pointer;
  opacity: 0;
  display: block;
  border-radius: 4px;
  background: #12181f;
  position: relative;
  z-index: 1;
}

.icon-item img.loaded {
  opacity: 1;
}


.icon-item > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  overflow: hidden;
}

/* Tooltip */

.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(224, 74, 20, 0.92);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.85em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 10px #e04a1488;
  z-index: 9999 !important; /* Ensure tooltip is on top */
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(224, 74, 20, 0.92) transparent transparent transparent;
}

.icon-item:hover .tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Back home link */

.back-home-container {
  text-align: center;
  margin: 20px 0;
}

.back-home {
  color: #e04a14;
  text-decoration: none;
  font-weight: 600;
  font-size: 1em;
  transition: color 0.2s ease;
}

.back-home:hover {
  color: #ff6a30;
  text-decoration: underline;
}

/* Search container */

.search-container {
  width: 90%;
  max-width: 400px;
  margin: 0 auto 20px auto;
  text-align: center;
}

#icon-search {
  flex-grow: 1;
  padding: 8px 12px;
  font-size: 1em;
  border: 1px solid #e04a14;
  border-radius: 4px;
  background: #12181f;
  color: #e04a14;
  outline: none;
  transition: border-color 0.2s ease;
}

#icon-search::placeholder {
  color: rgba(224, 74, 20, 0.75);
}

#icon-search:focus {
  border-color: #ff6a30;
}

/* Spinner styles */

.img-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid #e04a14;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}

.img-wrapper img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 4px;
  background: #12181f;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
  z-index: 1;
  display: block;
}

.img-wrapper img.loaded {
  opacity: 1;
}

/* Preloader */

#preloader {
  top: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 20, 0.75);
  width: 100%;
  height: 100%;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid #e04a14;
  border-top: 6px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Spinner animation */

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

/* Small header */

header.small-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px 16px;
  background: rgba(8, 11, 15, 0.92);
  border-bottom: 1px solid rgba(224, 74, 20, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  z-index: 100;
}

/* Reserve space for the fixed header so content isn't hidden underneath. */
body:has(header.small-header) {
  padding-top: 64px;
}

@media screen and (max-width: 600px) {
  body:has(header.small-header) {
    padding-top: 56px;
  }
}

header.small-header img {
  max-width: 32px;
}

header.small-header h1 {
  font-size: 1em;
  color: #ddd;
  margin: 0 0.5em;
  cursor: pointer;
  line-height: 1.1;
}

/* Responsive */

@media screen and (max-width: 600px) {
  .icons-grid {
    --tile-base: 60px;
    gap: 8px;
    padding: 10px;
  }

  .grid-back-to-top {
    right: 12px;
    bottom: max(20px, env(safe-area-inset-bottom));
  }

  h1 {
    font-size: 2em;
  }

  header img {
    max-width: 100px;
  }

  article {
    padding: 10px;
  }

  header.small-header h1 {
    display: none;
  }

  body article {
    position: relative;
  }

  #model-preview {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    border: 0 !important;
    height: 100% !important;
    width: 100% !important;
  }
}

/* Main container */

.main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
  position: relative;
}

/* Infinite-scroll sentinel — 1px probe below the grid that the
   IntersectionObserver watches to trigger the next batch. */
.grid-sentinel {
  width: 100%;
  min-height: 1px;
}

/* Grid toolbar — item count on the left, icon-toggle groups on the right. */

.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 auto 10px;
  padding: 6px 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85em;
  color: #aaa;
}

.grid-toolbar-count {
  color: #888;
  font-size: 0.9em;
  white-space: nowrap;
}

.grid-toolbar-count b {
  color: #e04a14;
  font-weight: 600;
}

.grid-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toolbar-group-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #777;
  font-size: 0.85em;
  user-select: none;
}

.toolbar-toggle-group {
  display: inline-flex;
  border: 1px solid rgba(224, 74, 20, 0.35);
  border-radius: 4px;
  overflow: hidden;
}

.toggle-btn {
  background: #12181f;
  color: #555;
  border: none;
  border-right: 1px solid rgba(224, 74, 20, 0.2);
  padding: 5px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}

.toggle-btn:last-child {
  border-right: none;
}

.toggle-btn:hover {
  background: rgba(224, 74, 20, 0.12);
  color: #c86030;
}

.toggle-btn.active {
  background: rgba(224, 74, 20, 0.2);
  color: #e04a14;
}

.toggle-btn:focus-visible {
  outline: 1px solid rgba(224, 74, 20, 0.6);
  outline-offset: -1px;
}

@media screen and (max-width: 600px) {
  .toggle-btn {
    padding: 7px 11px;
  }
}

/* Back-to-top floating button. */

.grid-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 60px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e04a14;
  background: rgba(18, 24, 31, 0.92);
  color: #e04a14;
  font-size: 22px;
  line-height: 42px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
  transform: translateY(8px);
  z-index: 500;
  box-shadow: 0 0 12px rgba(224, 74, 20, 0.4);
}

.grid-back-to-top.visible {
  opacity: 0.9;
  pointer-events: auto;
  transform: translateY(0);
}

.grid-back-to-top:hover {
  background: #e04a14;
  color: #fff;
}

/* List layout — one tile per row with inline name and copy button.
   The whole row is clickable via an `a::after` overlay; tooltip text is
   visual-only (pointer-events: none), copy-btn stays on top.

   Row geometry is driven by `--list-thumb` (thumbnail's shorter edge) so
   every row in a given grid has the same height and the name/copy column
   lines up cleanly across rows. Per-variant selectors override the image
   dimensions to match each category's native proxy thumbnail aspect. */

.icons-grid[data-layout="list"] {
  --list-thumb-base: 56px;
  --list-thumb: calc(var(--list-thumb-base) * var(--tile-scale, 1));
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  max-width: 900px;
  width: 100%;
}

.icons-grid[data-layout="list"] .icon-item,
.icons-grid.art-grid[data-layout="list"] .icon-item,
.icons-grid.portraits-grid[data-layout="list"] .icon-item,
.icons-grid.icons-small-grid[data-layout="list"] .icon-item {
  flex-direction: row;
  width: 100%;
  aspect-ratio: auto;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 12px;
  gap: 12px;
  height: calc(var(--list-thumb) + 8px);
  min-height: calc(var(--list-thumb) + 8px);
  box-sizing: border-box;
}

.icons-grid[data-layout="list"] .icon-item img {
  width: var(--list-thumb);
  height: var(--list-thumb);
  aspect-ratio: auto;
  flex-shrink: 0;
  object-fit: contain;
  padding: 0;
}

/* Art / consoles / terrain-cliffs / terrain-tilesets: 3:2 proxy thumbs. */
.icons-grid.art-grid[data-layout="list"] .icon-item img {
  width: calc(var(--list-thumb) * 1.5);
  height: var(--list-thumb);
}

/* Portraits: 2:3 proxy thumbs — taller than wide. Bump row height to match. */
.icons-grid.portraits-grid[data-layout="list"] {
  --list-thumb-base: 48px;
}

.icons-grid.portraits-grid[data-layout="list"] .icon-item {
  height: calc(var(--list-thumb) * 1.5 + 8px);
  min-height: calc(var(--list-thumb) * 1.5 + 8px);
}

.icons-grid.portraits-grid[data-layout="list"] .icon-item img {
  width: var(--list-thumb);
  height: calc(var(--list-thumb) * 1.5);
}

/* Small icons: native 30px thumbs — keep them petite in list mode too. */
.icons-grid.icons-small-grid[data-layout="list"] .icon-item img {
  width: 32px;
  height: 32px;
}

.icons-grid[data-layout="list"] .icon-item > a {
  width: auto;
  height: auto;
  overflow: visible;
  flex-shrink: 0;
  position: static;
}

.icons-grid[data-layout="list"] .icon-item > a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 4px;
}

.icons-grid[data-layout="list"] .icon-item .tooltip {
  position: static;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  background: transparent;
  color: #ddd;
  box-shadow: none;
  font-size: 0.9em;
  padding: 0;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icons-grid[data-layout="list"] .icon-item .tooltip::after {
  display: none;
}

.icons-grid[data-layout="list"] .icon-item:hover,
.icons-grid[data-layout="list"] .icon-item:has(a:focus-visible),
.icons-grid[data-layout="list"] .icon-item:has(a:active) {
  background: rgba(224, 74, 20, 0.09);
}

/* Copy to clipboard tooltip */

[data-copy] {
  cursor: pointer;
  position: relative;
}

[data-copy]::after {
  content: 'Click to copy';
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #333;
  color: #fff;
  font-size: 7px;
  padding: 3px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  line-height: 10px;
  white-space: nowrap;
  z-index: 111;
}

[data-copy]:hover::after {
  opacity: 1;
}

[data-copy].copied::after {
  content: 'Copied!';
  background: #4caf50;
}

/* Buttons */

.btn {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #e04a14;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  line-height: 28px;
  text-align: center;
}

/* Logo container */

.logo-container {
}

/* Portrait grids — tile drives aspect, image fills it (matches 200x300 proxy thumbs). */

.portraits-grid .icon-item {
  width: calc(var(--tile-base) * var(--tile-scale));
  height: calc(var(--tile-base) * var(--tile-scale) * 3 / 2);
}

.portraits-grid .icon-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

/* Art grid — tile drives aspect, image fills it (matches 300x200 proxy thumbs). */

.icons-grid.art-grid {
  --tile-base: 150px;
}

.icons-grid.art-grid .icon-item {
  width: calc(var(--tile-base) * var(--tile-scale));
  height: calc(var(--tile-base) * var(--tile-scale) * 2 / 3);
}

.icons-grid.art-grid .icon-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

/* Small icons grid */

.icons-grid.icons-small-grid {
  --tile-base: 30px;
}

.icons-grid.icons-small-grid .icon-item,
.icons-grid.icons-small-grid .icon-item img {
  width: calc(var(--tile-base) * var(--tile-scale));
  height: calc(var(--tile-base) * var(--tile-scale));
}

/* Scrollbar styling for fine pointer devices */

@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    min-height: 60px;
  }

  ::-webkit-scrollbar-track {}

  ::-webkit-scrollbar-corner {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: #e04a14;
    min-height: 100px;
  }
}

/* Footer */

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
  padding: 0.6rem;
  border-top: 1px solid rgba(224, 74, 20, 0.25);
  width: 100%;
}

footer a {
  margin: 0px 6px;
  display: flex;
  color: #555;
  transition: color 0.2s;
}

footer a:hover {
  color: #e04a14;
}

/* ── Unified panels (landing page sections) ─────────────────────── */

.panel {
  margin: 24px auto;
  width: 90%;
  max-width: 900px;
}

.panel-title {
  font-family: 'Oxanium', 'Orbitron', 'Michroma', sans-serif;
  font-weight: 600;
  font-size: 1.3em;
  color: #e8c8b0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 10px;
  text-align: center;
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Hero variant — used on the landing intro panel for the brand title */
.panel-title--hero {
  font-size: 2em;
  color: #e8c8b0;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

/* Decorative SVG separator below the title */
.panel-title::after {
  content: '';
  display: block;
  margin: 8px auto 0;
  width: 200px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14'%3E%3Cline x1='0' y1='7' x2='78' y2='7' stroke='%23e04a14' stroke-width='1' stroke-opacity='0.55'/%3E%3Cpolygon points='88,7 94,2 100,7 94,12' fill='none' stroke='%23e04a14' stroke-width='1.2' stroke-opacity='0.85'/%3E%3Cline x1='106' y1='7' x2='200' y2='7' stroke='%23e04a14' stroke-width='1' stroke-opacity='0.55'/%3E%3Ccircle cx='100' cy='7' r='2.2' fill='%23e04a14' fill-opacity='0.9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.panel-body {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(224, 74, 20, 0.55);
  border-radius: 6px;
  padding: 14px 16px;
  background: rgba(14, 6, 2, 0.88);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(224, 74, 20, 0.15);
}

/* Subtle hex-grid pattern overlay inside panels */
.panel-body::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 5px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  /* Two offset copies of the same hex polygon for a honeycomb tiling */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='32'%3E%3Cpolygon points='14,1 26,8 26,24 14,31 2,24 2,8' fill='none' stroke='%23e04a14' stroke-width='0.8'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='32'%3E%3Cpolygon points='14,1 26,8 26,24 14,31 2,24 2,8' fill='none' stroke='%23e04a14' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 28px 32px, 28px 32px;
  background-position: 0 0, 14px 16px;
}

/* .links inside a panel-body — remove double-layered background */
.panel-body .links {
  background: transparent;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Attribution-style prose inside panels */
.panel-body p {
  margin: 0 0 10px;
  font-size: 1.05em;
  color: #cfcfcf;
  text-align: left;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  line-height: 1.65;
}

.panel-body p:last-child {
  margin-bottom: 0;
}

/* Keep .attribution-card working for any legacy usage */
.attribution-card {
  margin: 20px auto;
  max-width: 700px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(224, 74, 20, 0.35);
  border-radius: 6px;
  padding: 16px 20px;
  font-size: 0.9em;
  color: #aaa;
  line-height: 1.6;
  text-align: left;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 300;
}

.attribution-card p {
  margin: 0 0 8px;
  font-size: 1em;
  color: #aaa;
  text-align: left;
}

.attribution-card p:last-child {
  margin-bottom: 0;
}

.discord-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.discord-widget {
  background: #12181f;
  border: 1px solid #e04a14;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}

.discord-widget:hover {
  box-shadow: 0 0 12px rgba(224, 74, 20, 0.55);
}

.discord-widget img.widget-banner {
  width: 100%;
  height: 40px;
  object-fit: cover;
  display: block;
}

.discord-widget .widget-info {
  padding: 10px 12px;
}

.discord-widget .widget-name {
  font-size: 0.85em;
  font-weight: 600;
  color: #e04a14;
  margin: 0 0 4px;
}

.discord-widget .widget-desc {
  font-size: 0.78em;
  color: #888;
  margin: 0;
}

.discord-widget .widget-online {
  font-size: 0.72em;
  color: #5a5;
  margin: 4px 0 0;
}

.discord-widget-fallback {
  position: relative;
  background: #12181f;
  border: 1px solid #e04a14;
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  display: block;
  transition: box-shadow 0.2s ease;
}

.discord-widget-fallback::before {
  display: block;
  content: '';
  margin: 0;
  margin-left: -16px;
  margin-right: -16px;
  margin-top: -14px;
  height: 40px;
  margin-bottom: 10px;
  background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='32'%3E%3Cpolygon points='14,1 26,8 26,24 14,31 2,24 2,8' fill='none' stroke='%23e04a14' stroke-width='0.8' stroke-opacity='0.1' /%3E%3C/svg%3E");
  background-size: auto 20px;
  background-color: rgba(0, 0, 0, 0.25);
  background-attachment: fixed;
  background-repeat: space;
}

.discord-widget-fallback:hover {
  box-shadow: 0 0 12px rgba(224, 74, 20, 0.55);
}

.discord-widget-fallback .widget-name {
  font-size: 0.85em;
  font-weight: 600;
  color: #e04a14;
  margin: 0 0 4px;
}

.discord-widget-fallback .widget-desc {
  font-size: 0.78em;
  color: #888;
  margin: 0;
}

/* Header logo styles (landing page) */

.header-icon {
  max-width: 60px;
  vertical-align: middle;
}

.header-logo {
  max-height: 46px;
  vertical-align: middle;
  margin-left: 10px;
}

/* Category page subtitle in small header */

header.small-header .subtitle {
  font-size: 0.68em;
  color: #9aa0a8;
  margin: 0;
  font-family: 'Michroma', sans-serif;
  letter-spacing: 0.05em;
}

/* PhotoSwipe custom-caption (per https://photoswipe.com/caption/) */
.pswp__custom-caption {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  max-width: 70%;
  padding: 6px 14px;
  font-family: 'Michroma', sans-serif;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
}

.pswp__caption-name {
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pswp__caption-desc {
  display: none;
  font-size: 12px;
  line-height: 1.4;
  padding-top: 6px;
  opacity: 0.8;
  white-space: normal;
}

.pswp__custom-caption.has-desc .pswp__caption-desc {
  display: block;
}

/* Copy-name button tints green for ~1s after click */
.pswp__button--custom-copy-btn.copied .pswp__icn {
  fill: #4cff7a;
}

@media screen and (max-width: 600px) {
  .discord-widgets-grid {
    grid-template-columns: 1fr;
  }

  .header-logo {
    max-height: 28px;
  }

  header.small-header .subtitle {
    display: none;
  }

  /* Variant grids override base --tile-base via selector specificity; their
     default rules appear above this MQ in source order, so repeat the narrower
     mobile values down here to win the cascade. */
  .icons-grid.art-grid { --tile-base: 120px; }
  .icons-grid.portraits-grid { --tile-base: 80px; }

  .icons-grid[data-layout="list"] { --list-thumb-base: 44px; }
  .icons-grid.portraits-grid[data-layout="list"] { --list-thumb-base: 36px; }
}
