@font-face {
  font-family: "Boiled Pasta";
  src: url("Boiled Pasta.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Small Type Writing";
  src: url("SmallTypeWriting.ttf") format("truetype");
  font-display: swap;
}

:root {
  --outer: #f6b6d0;
  --panel: #fffafd;
  --pink-1: #ffd9eb;
  --pink-2: #f6b8d5;
  --pink-3: #ed8fbb;
  --pink: #f6b6d0;
  --light-pink: #fff0f8;
  --hot-pink: #c34f88;
  --line: #e7a8c5;
  --text: #5a3046;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px 12px;
  background: var(--outer);
  background-image: radial-gradient(rgba(255,255,255,0.58) 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  color: var(--text);
  font-family: "Small Type Writing", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: -12px;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    8vw 4vh 0 #fff,
    19vw 18vh 0 #fff,
    31vw 8vh 0 #fff,
    46vw 25vh 0 #fff,
    61vw 12vh 0 #fff,
    76vw 30vh 0 #fff,
    91vw 7vh 0 #fff,
    14vw 46vh 0 #fff,
    39vw 58vh 0 #fff,
    68vw 50vh 0 #fff,
    84vw 68vh 0 #fff;
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
  animation: fallingStars 9s linear infinite;
}

body::after {
  top: -30px;
  left: 5vw;
  width: 2px;
  height: 2px;
  box-shadow:
    12vw 12vh 0 #fff,
    27vw 34vh 0 #fff,
    53vw 5vh 0 #fff,
    72vw 22vh 0 #fff,
    96vw 42vh 0 #fff,
    22vw 66vh 0 #fff,
    58vw 76vh 0 #fff,
    88vw 58vh 0 #fff;
  opacity: 0.55;
  animation-delay: -4.5s;
}

@keyframes fallingStars {
  0% { transform: translateY(-8vh); }
  100% { transform: translateY(115vh); }
}

.cursor-sparkle {
  position: fixed;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 20;
  color: #fff;
  transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  animation: cursorSparkle 700ms ease-out forwards;
}

.cursor-sparkle::before,
.cursor-sparkle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 0 6px 2px rgba(255,255,255,0.9);
}

.cursor-sparkle::before {
  width: 3px;
  height: 100%;
  transform: translate(-50%, -50%);
}

.cursor-sparkle::after {
  width: 100%;
  height: 3px;
  transform: translate(-50%, -50%);
}

@keyframes cursorSparkle {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(1.3) rotate(45deg);
  }
}

.page {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #f9c5dc 0%, #fbd8e8 48%, #f7bed5 100%);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 10px 24px rgba(197,117,154,0.18);
}

.fanart-page-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 900px) 160px;
  gap: 18px;
  align-items: start;
  max-width: 1256px;
  margin: 0 auto;
}

.side-ad-slot {
  position: relative;
  position: sticky;
  top: 24px;
  width: 160px;
  height: 600px;
}

.ad-close {
  position: absolute;
  z-index: 1;
  top: -9px;
  right: -9px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fffafd;
  color: var(--hot-pink);
  cursor: pointer;
  font-family: "Small Type Writing", sans-serif;
  font-size: 14px;
  font-weight: bold;
  line-height: 18px;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.95);
}

.ad-close:hover,
.ad-close:focus-visible {
  outline: 2px solid var(--hot-pink);
  outline-offset: 2px;
  background: var(--pink-1);
}

.ad-placeholder {
  display: grid;
  width: 160px;
  height: 600px;
  place-items: center;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--panel), var(--pink-1));
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 15px;
  text-align: center;
  text-transform: lowercase;
  box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.95), 0 0 24px rgba(255, 255, 255, 0.55);
}

.side-ad-slot img {
  display: block;
  width: 160px;
  height: 600px;
  border: 2px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.95), 0 0 24px rgba(255, 255, 255, 0.55);
}

.page-header {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(135deg, var(--panel), var(--pink-1));
  text-align: center;
}

.page-header h1 {
  margin: 0;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 30px;
  text-transform: lowercase;
}

.page-header p {
  margin: 7px 0 0;
  color: #d85a91;
  font-family: "Small Type Writing", sans-serif;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 10px 0;
}

.page-nav a {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffafd;
  color: var(--hot-pink);
  text-decoration: none;
  font-family: "Small Type Writing", sans-serif;
  font-weight: bold;
}

.page-nav a:hover { background: var(--pink-1); }

.page-content {
  min-height: 420px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.page-content h2 {
  margin: 0 0 8px;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  text-transform: lowercase;
}

.note {
  padding: 14px;
  border: 1px dashed #b58a73;
  background: #fffaf1;
  font-family: "Small Type Writing", sans-serif;
  line-height: 1.6;
}

.note a {
  color: var(--hot-pink);
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}

.note a:hover,
.note a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.contact-label {
  position: relative;
  margin: 23px 0 16px;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: lowercase;
}

.contact-label::before,
.contact-label::after {
  position: absolute;
  top: 50%;
  width: 27%;
  border-top: 1px dashed var(--line);
  content: "";
}

.contact-label::before { left: 0; }
.contact-label::after { right: 0; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.contact-card {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border: 1px solid #e7c2d1;
  border-radius: 5px;
  background: linear-gradient(180deg, #fffafd, #ffe8f4);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(195, 79, 136, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
  outline: none;
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 7px 0 rgba(195, 79, 136, 0.17);
}

.contact-card:nth-child(even) { transform: rotate(1deg); }
.contact-card:nth-child(even):hover,
.contact-card:nth-child(even):focus-visible { transform: translateY(-3px) rotate(0deg); }

.contact-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid var(--hot-pink);
  border-radius: 50%;
  background: #fffafd;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 17px;
}

.contact-card strong {
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 15px;
  font-weight: normal;
  text-transform: lowercase;
}

.contact-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.contact-card-empty {
  border-style: dashed;
  background: #fffaf1;
}

.contact-details {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #c38b9f;
  background: #fffaf1;
}

.contact-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--paper-line);
  color: var(--paper-ink);
  font-size: 13px;
}

.contact-details div:last-child { padding-bottom: 0; border-bottom: 0; }
.contact-details strong { color: var(--hot-pink); font-weight: normal; }
.contact-details .contact-open {
  color: #58b878;
  text-shadow: 0 0 5px rgba(142, 232, 166, 0.9), 0 0 10px rgba(142, 232, 166, 0.55);
}
.contact-details a { color: var(--hot-pink); text-decoration: none; }
.contact-details a:hover,
.contact-details a:focus-visible { text-decoration: underline; }

.terms-notice {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #efafd0;
  border-radius: 4px;
  background: linear-gradient(135deg, #fffafd, #ffe8f4);
  color: var(--paper-ink);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

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

.terms-block {
  border: 1px solid #e7c2d1;
  border-radius: 5px;
  overflow: hidden;
  background: #fffafd;
  box-shadow: 0 4px 0 rgba(195, 79, 136, 0.1);
}

.terms-block h3 {
  margin: 0;
  padding: 9px;
  background: linear-gradient(135deg, #fffafd, #ffd6e9);
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 15px;
  font-weight: normal;
  text-align: center;
  text-transform: lowercase;
}

.terms-block ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 11px;
  background: #fffaf1;
  color: var(--paper-ink);
  list-style: none;
}

.terms-block li {
  padding: 8px 2px 8px 17px;
  border-bottom: 1px dashed var(--paper-line);
  font-size: 12px;
  line-height: 1.45;
}

.terms-block li:last-child { border-bottom: 0; }
.terms-block li::before { content: "♥"; margin-left: -15px; margin-right: 7px; color: #ed6fa9; }
.terms-block-refused li::before { content: "×"; color: var(--hot-pink); }

.terms-contact {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

.terms-contact a { color: var(--hot-pink); font-weight: bold; text-decoration: none; }
.terms-contact a:hover,
.terms-contact a:focus-visible { text-decoration: underline; }

.commission-ribbon {
  position: relative;
  display: block;
  margin: 12px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(135deg, #fffafd, #ffd6e9);
  color: var(--hot-pink);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(195, 79, 136, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.commission-ribbon::before,
.commission-ribbon::after {
  content: "♡";
  margin: 0 8px;
  color: #ed6fa9;
}

.commission-ribbon:hover,
.commission-ribbon:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(195, 79, 136, 0.16);
}

.commission-ribbon strong {
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-weight: normal;
  text-transform: lowercase;
}

.construction-page {
  display: grid;
  min-height: 520px;
  place-items: center;
  overflow: hidden;
}

.construction-panel {
  position: relative;
  display: grid;
  width: min(620px, 100%);
  min-height: 270px;
  place-items: center;
  padding: 42px 24px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fffafd;
  box-shadow: 0 7px 0 rgba(195, 79, 136, 0.12);
  overflow: hidden;
  text-align: center;
}

.construction-panel h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 30px;
  text-transform: lowercase;
}

.construction-panel p {
  position: relative;
  z-index: 2;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.construction-tape {
  position: absolute;
  z-index: 3;
  width: 125%;
  padding: 8px 0;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: repeating-linear-gradient(135deg, #f08ab5 0 18px, #fff 18px 36px);
  color: #a83d70;
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  transform: rotate(-9deg);
}

.construction-tape-top { top: 48px; }
.construction-tape-bottom { bottom: 48px; transform: rotate(8deg); }

.commission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 15px 10px 12px;
  border: 1px solid rgba(231, 168, 197, 0.6);
  border-radius: 5px;
  background-color: rgba(255, 250, 253, 0.72);
  background-image: radial-gradient(rgba(195, 79, 136, 0.16) 1px, transparent 1px);
  background-size: 14px 14px;
}

.commission-card {
  position: relative;
  appearance: none;
  display: flex;
  width: 100%;
  min-height: 135px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid #e7c2d1;
  border-radius: 5px;
  background: linear-gradient(180deg, #fffafd, #ffe8f4);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: center;
  box-shadow: 0 4px 0 rgba(195, 79, 136, 0.12);
  transform: rotate(-1deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.commission-card:nth-child(2) { transform: rotate(1deg); }
.commission-card:nth-child(3) { transform: rotate(-2deg); }

.commission-card::before {
  position: absolute;
  top: 7px;
  left: 9px;
  color: #ed6fa9;
  content: "✦";
  font-size: 13px;
  animation: commissionTwinkle 1.8s ease-in-out infinite;
}

.commission-card:nth-child(2)::before { animation-delay: 0.45s; }
.commission-card:nth-child(3)::before { animation-delay: 0.9s; }

@keyframes commissionTwinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}

.commission-card strong {
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 16px;
  font-weight: normal;
  text-transform: lowercase;
}

.commission-card b {
  margin-top: 7px;
  color: var(--text);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 26px;
  font-weight: normal;
}

.commission-extra {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed #c38b9f;
  background: #fffaf1;
  color: var(--paper-ink);
  font-size: 13px;
  line-height: 1.5;
}

.commission-card::after {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 5px;
  border: 1px solid #ed9fc2;
  border-radius: 2px;
  background: #fff0f8;
  color: var(--hot-pink);
  content: "click me!";
  font-size: 10px;
  opacity: 0;
  transform: rotate(4deg) scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.commission-card:hover::after,
.commission-card:focus-visible::after {
  opacity: 1;
  transform: rotate(4deg) scale(1);
}

.commission-card:hover,
.commission-card:focus-visible {
  outline: 2px solid var(--hot-pink);
  outline-offset: 2px;
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 8px 0 rgba(195, 79, 136, 0.16), 0 10px 16px rgba(90, 48, 70, 0.1);
}

.commission-extra strong { color: var(--hot-pink); font-weight: normal; }
.commission-extra a { color: var(--hot-pink); font-weight: bold; text-decoration: none; }
.commission-extra a:hover,
.commission-extra a:focus-visible { text-decoration: underline; }

.commission-button {
  display: inline-block;
  width: max-content;
  margin: 0;
  padding: 9px 15px;
  border: 2px solid var(--hot-pink);
  border-radius: 4px;
  background: linear-gradient(180deg, #ffdff0, #f5a9cb);
  color: #7d3157;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(195, 79, 136, 0.2);
}

.commission-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.commission-actions p {
  flex-basis: 100%;
  margin: 0 0 2px;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 17px;
  text-align: center;
  text-transform: lowercase;
}

.commission-button:hover,
.commission-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  background: linear-gradient(180deg, #fff0f8, #ed8fbb);
}

.fanart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.gallery-label {
  position: relative;
  margin-top: 23px;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: lowercase;
}

.gallery-label::before,
.gallery-label::after {
  position: absolute;
  top: 50%;
  width: 28%;
  border-top: 1px dashed var(--line);
  content: "";
}

.gallery-label::before { left: 0; }
.gallery-label::after { right: 0; }

.character-dossier,
.archive-dossier {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 16px;
  padding: 9px 11px;
  border: 1px solid #efafd0;
  border-radius: 4px;
  background: #fff4f9;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.character-dossier strong,
.archive-dossier strong {
  color: var(--hot-pink);
  font-weight: normal;
}

.character-grid,
.archive-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  padding: 17px 12px 13px;
  border: 1px solid rgba(231, 168, 197, 0.65);
  border-radius: 5px;
  background-color: #fff8fc;
  background-image:
    linear-gradient(rgba(237, 143, 187, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 143, 187, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
}

.character-page .fanart-card,
.archive-page .fanart-card {
  border-color: #d99aba;
  background: linear-gradient(180deg, #fffafd, #ffeaf4);
}

.character-page .fanart-card img,
.archive-page .fanart-card img {
  aspect-ratio: 3 / 4;
  background: #fff7fb;
  object-fit: contain;
}

.character-card-primary,
.archive-card-primary {
  grid-column: span 2;
}

.character-card-primary img,
.archive-card-primary img {
  aspect-ratio: 16 / 10 !important;
}

.original-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 18px 10px 12px;
  border: 1px solid rgba(231, 168, 197, 0.55);
  border-radius: 5px;
  background-color: rgba(255, 250, 253, 0.72);
  background-image: radial-gradient(rgba(195, 79, 136, 0.16) 1px, transparent 1px);
  background-size: 14px 14px;
}

.original-tile {
  position: relative;
  display: flex;
  min-height: 155px;
  flex-direction: column;
  justify-content: end;
  padding: 18px 14px 14px;
  border: 1px solid #e7c2d1;
  border-radius: 3px;
  background: #fffdfd;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 5px 0 rgba(195, 79, 136, 0.12), 0 8px 14px rgba(90, 48, 70, 0.08);
  transform: rotate(-1deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.original-tile::before {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 42px;
  height: 13px;
  border: 1px solid rgba(237, 159, 194, 0.45);
  background: rgba(255, 226, 239, 0.78);
  content: "";
  transform: translateX(-50%) rotate(-3deg);
}

.original-tile:nth-child(2) { transform: rotate(1deg); }
.original-tile:nth-child(3) { transform: rotate(-2deg); }

.original-tile:hover,
.original-tile:focus-visible {
  outline: none;
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 8px 0 rgba(195, 79, 136, 0.16), 0 12px 18px rgba(90, 48, 70, 0.12);
}

.original-tile strong {
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 18px;
  text-transform: lowercase;
}

.original-tile span {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.fanart-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 8px 8px 15px;
  border: 1px solid #e7c2d1;
  border-radius: 3px;
  background: #fffdfd;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 5px 0 rgba(195, 79, 136, 0.12), 0 8px 14px rgba(90, 48, 70, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fanart-card::before {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 42px;
  height: 13px;
  border: 1px solid rgba(237, 159, 194, 0.45);
  background: rgba(255, 226, 239, 0.78);
  box-shadow: 0 1px 2px rgba(90, 48, 70, 0.08);
  content: "";
  transform: translateX(-50%) rotate(-3deg);
}

.fanart-card figure { margin: 0; }

.fanart-card:nth-child(even) { transform: rotate(1deg); }
.fanart-card:nth-child(odd) { transform: rotate(-1deg); }
.fanart-card:nth-child(3n)::before { transform: translateX(-50%) rotate(3deg); }

.fanart-card:hover,
.fanart-card:focus-visible {
  outline: none;
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 8px 0 rgba(195, 79, 136, 0.16), 0 12px 18px rgba(90, 48, 70, 0.12);
}

.fanart-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid #ead8de;
  background: #fff;
  object-fit: cover;
}

.fanart-card figcaption {
  padding: 11px 2px 0;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 15px;
  text-align: center;
  text-transform: lowercase;
}

.commission-detail-panel {
  position: relative;
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding: 16px 42px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(135deg, #fffafd, #fff0f8);
  background-image: radial-gradient(rgba(195, 79, 136, 0.12) 1px, transparent 1px);
  background-size: 14px 14px;
  box-shadow: 0 5px 0 rgba(195, 79, 136, 0.12);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.commission-detail-panel.is-open {
  display: grid;
  opacity: 1;
  transform: translateY(0);
}

.commission-detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.commission-detail-gallery a {
  display: block;
  min-width: 0;
}

.commission-detail-gallery img {
  display: block;
  width: 100%;
  height: 112px;
  border: 1px solid #ead8de;
  object-fit: contain;
}

.commission-detail-panel.icons-gallery .commission-detail-gallery img {
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
}

.commission-detail-panel h3 {
  margin: 0;
  color: var(--hot-pink);
  font-family: "Boiled Pasta", "Small Type Writing", sans-serif;
  font-size: 20px;
  font-weight: normal;
  text-transform: lowercase;
}

.commission-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff0f8;
  color: var(--hot-pink);
  cursor: pointer;
  font-weight: bold;
}

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(90, 48, 70, 0.78);
}

.lightbox-inner {
  position: relative;
  max-width: min(900px, 100%);
  max-height: 90vh;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #fffafd;
  box-shadow: 0 10px 30px rgba(90, 48, 70, 0.35);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 20px);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -13px;
  right: -13px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fffafd;
  color: var(--hot-pink);
  cursor: pointer;
  font-family: "Small Type Writing", sans-serif;
  font-weight: bold;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  outline: 2px solid var(--hot-pink);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  body { padding: 8px 5px; }
  .page-content { padding: 14px; }
  .fanart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 6px 9px; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 6px 9px; }
  .character-dossier,
  .archive-dossier { gap: 5px 11px; }
  .character-card-primary,
  .archive-card-primary { grid-column: span 2; }
  .gallery-label { margin-top: 20px; }
  .gallery-label::before,
  .gallery-label::after { width: 20%; }
  .original-board { grid-template-columns: 1fr; gap: 10px; padding: 14px 6px 9px; }
  .fanart-card { padding: 5px 5px 8px; }
  .fanart-card figcaption { font-size: 13px; }
  .lightbox { padding: 12px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { min-height: 92px; }
  .contact-details div { flex-direction: column; gap: 2px; }
  .commission-grid { grid-template-columns: 1fr; }
  .commission-extra { flex-direction: column; }
  .commission-detail-panel { grid-template-columns: 1fr; text-align: center; }
  .terms-grid { grid-template-columns: 1fr; }
  .construction-page { min-height: 480px; }
  .construction-panel h2 { font-size: 25px; }
  .commission-detail-gallery { max-height: 210px; }
}

@media (max-width: 1250px) {
  .fanart-page-layout {
    display: block;
  }

  .side-ad-slot {
    display: none;
  }
}