/* ── Site gate ───────────────────────────────────────── */

.site-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #05020e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Share Tech Mono", "Courier New", monospace;
}

.site-gate-box {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: min(400px, 90vw);
}

.site-gate-header {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: rgba(196, 160, 255, 0.82);
  margin: 0;
  border-bottom: 1px solid rgba(155, 95, 255, 0.28);
  padding-bottom: 0.6rem;
}

.site-gate-sub {
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: rgba(210, 178, 255, 0.8);
  margin: 0;
}

.site-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.site-gate-label {
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: rgba(196, 160, 255, 0.87);
}

.site-gate-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(155, 95, 255, 0.2);
  padding: 0.4rem 0.6rem;
  background: rgba(4, 2, 12, 0.9);
}

.site-gate-prompt {
  font-size: 0.65rem;
  color: rgba(155, 95, 255, 0.7);
  flex-shrink: 0;
}

.site-gate-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(210, 178, 255, 0.9);
  caret-color: rgba(155, 95, 255, 0.93);
}

.site-gate-error {
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  color: rgba(255, 80, 80, 0.93);
  margin: 0;
  text-shadow: 0 0 8px rgba(255, 60, 60, 0.4);
  animation: gate-flicker 0.15s ease 2;
}

@keyframes gate-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.site-gate-btn {
  background: transparent;
  border: 1px solid rgba(155, 95, 255, 0.22);
  color: rgba(155, 95, 255, 0.75);
  font-family: inherit;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  align-self: flex-start;
}

.site-gate-btn:hover {
  background: rgba(155, 95, 255, 0.06);
  color: rgba(210, 178, 255, 0.9);
  border-color: rgba(155, 95, 255, 0.7);
}

/* ── */

.app-logo.large {
  width: 320px;
  max-width: 80vw;
  height: auto;
}
/* Centered logo styling */
.logo-container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-logo {
  width: 120px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 16px #9b5fff88);
}

.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 2.2rem;
  display: flex;
  align-items: stretch;
  padding: 4px 4px 0;
  background: linear-gradient(180deg, rgba(6, 4, 14, 0.98) 0%, rgba(8, 5, 18, 0.94) 100%);
  border-bottom: 1px solid rgba(155, 95, 255, 0.12);
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.nav-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(180, 130, 255, 0.22) 0 1px,
    rgba(0, 0, 0, 0.32) 1px 3px
  );
  opacity: 0.55;
  animation: scanline-drift 12s linear infinite;
}

.cabinet-menu {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  position: relative;
  z-index: 1;
}

.cabinet-menu::-webkit-scrollbar {
  display: none;
}

/* ── Per-tab colour identity ──────────────────────────── */
/* --tc: R, G, B  used via rgba(var(--tc), opacity)       */
.tag-amber   { --tc: 155,  95, 255; }
.tag-olive   { --tc: 110, 220,  80; }
.tag-red     { --tc: 220,  55,  65; }
.tag-blue    { --tc:  60, 200, 220; }
.tag-purple  { --tc: 190,  90, 255; }
.tag-admin   { --tc: 255, 140,  50; }
.tag-account { --tc: 180, 130, 255; }
.tag-login   { --tc: 180, 130, 255; }

.cabinet-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  /* Thick coloured top stripe = the card's colour identity (like a coloured folder tab) */
  border-top: 4px solid rgba(var(--tc), 0.85);
  border-left: 1px solid rgba(var(--tc), 0.20);
  border-right: none;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  padding: 0 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  color: rgba(var(--tc), 0.72);
  text-shadow: 0 0 6px rgba(var(--tc), 0.18);
  /* Tab body is slightly lighter than the nav — a separate physical card sitting in the drawer */
  background: #181228;
  cursor: pointer;
  /* Hard right shadow = the card's physical thickness (2px of visible "edge") */
  box-shadow:
    2px 0 0 #000,
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  transition: color 140ms ease, text-shadow 140ms ease, background 140ms ease,
              border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
  z-index: 1;
}

/* Phosphor glow strip under the top colour bar — CRT bleed */
.cabinet-tag::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.25rem;
  background: rgba(var(--tc), 0.18);
  pointer-events: none;
}

/* Hover scan sweep — CRT phosphor charge across the card face */
.cabinet-tag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent            0%,
    rgba(var(--tc), 0.05) 40%,
    rgba(var(--tc), 0.18) 50%,
    rgba(var(--tc), 0.05) 60%,
    transparent           100%
  );
  transform: translateX(-140%);
  z-index: 1;
}

.cabinet-tag:hover::after {
  animation: tab-scan 380ms ease-out forwards;
}

@keyframes tab-scan {
  from { transform: translateX(-140%); }
  to   { transform: translateX(140%); }
}

.cabinet-tag:hover {
  color: rgba(var(--tc), 0.95);
  text-shadow: 0 0 8px rgba(var(--tc), 0.45);
  border-top-color: rgba(var(--tc), 1);
  background: #1e1535;
  box-shadow:
    2px 0 0 #000,
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

.cabinet-tag:focus-visible {
  outline: 2px solid rgba(248, 244, 215, 0.95);
  outline-offset: 2px;
}

/* Active = this drawer is open: card rises, coloured light floods down into the page */
.cabinet-tag.is-active {
  color: rgba(var(--tc), 1);
  text-shadow:
    0 0  6px rgba(var(--tc), 1),
    0 0 16px rgba(var(--tc), 0.5);
  border-top: 4px solid rgba(var(--tc), 1);
  border-left-color: rgba(var(--tc), 0.40);
  background: #221840;
  /* Card physically rises out of the drawer slot */
  transform: translateY(-3px);
  z-index: 3;
  box-shadow:
    /* Physical thickness — right edge stays dark */
    2px 0 0 #000,
    /* Open-drawer light: coloured glow floods DOWN into the content area */
    0  6px 20px -1px rgba(var(--tc), 0.7),
    0 12px 40px -4px rgba(var(--tc), 0.4),
    0  2px  6px  0px rgba(var(--tc), 0.5);
}

/* Brighter glow strip under top bar when active */
.cabinet-tag.is-active::before {
  background: rgba(var(--tc), 0.40);
  box-shadow: 0 2px 8px rgba(var(--tc), 0.3);
}
html {
  /* Scale the rem base fluidly: stays 16px on mobile, reaches 22px on wide laptops.
     All rem values in this file scale with it — no per-element overrides needed. */
  font-size: clamp(16px, 1.65vw, 22px);
}

:root {
  font-family: "Courier New", Consolas, monospace;
  line-height: 1.4;
  font-weight: 400;
  color-scheme: dark;
  color: #dbbeff;
  background: #070510;
  --crt-opening-inset-x: 3.6667%;
  --crt-opening-inset-y: 5.5%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100dvw;
  min-height: 100dvh;
  background: #0b0912;
  overflow: hidden;
  overscroll-behavior: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cline x1='11' y1='1' x2='11' y2='9' stroke='%239b5fff' stroke-width='1.5' opacity='0.85'/%3E%3Cline x1='11' y1='13' x2='11' y2='21' stroke='%239b5fff' stroke-width='1.5' opacity='0.85'/%3E%3Cline x1='1' y1='11' x2='9' y2='11' stroke='%239b5fff' stroke-width='1.5' opacity='0.85'/%3E%3Cline x1='13' y1='11' x2='21' y2='11' stroke='%239b5fff' stroke-width='1.5' opacity='0.85'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%239b5fff' opacity='0.85'/%3E%3C/svg%3E") 11 11, crosshair;
}

a, button {
  cursor: pointer;
}

#root {
  width: 100dvw;
  height: 100dvh;
  max-width: none;
}

.crt-page {
  position: fixed;
  left: 0;
  top: 0;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
}

.crt-border {
  position: fixed;
  left: 0;
  top: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 20;
  pointer-events: none;
}

.crt-border img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.crt-content {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.crt-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(180, 110, 255, 0.11), rgba(5, 3, 12, 0.94) 62%),
    #070510;
  box-shadow:
    inset 0 0 48px rgba(160, 80, 255, 0.07);
  overflow: hidden;
  isolation: isolate;
}

/* ── Ambient section colour leak — tints the screen corners ─ */
.page-viewport:has(.home-panel)        { --leak: 155,  95, 255; }
.page-viewport:has(.shop-panel)        { --leak: 110, 220,  80; }
.page-viewport:has(.lore-panel)        { --leak: 220,  55,  65; }
.page-viewport:has(.blog-panel)        { --leak: 190,  90, 255; }
.page-viewport:has(.contact-panel)     { --leak:  60, 200, 220; }
.page-viewport:has(.cart-page)         { --leak: 245, 200,  50; }
.page-viewport:has(.admin-panel)       { --leak: 255, 140,  50; }
.page-viewport:has(.admin-login-panel) { --leak: 180, 130, 255; }

.page-viewport::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 35% at 0% 0%,
      rgba(var(--leak, 155, 95, 255), 0.055) 0%, transparent 100%),
    radial-gradient(ellipse 55% 35% at 100% 100%,
      rgba(var(--leak, 155, 95, 255), 0.055) 0%, transparent 100%);
}

.page-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 95, 255, 0.65) transparent;
}

.page-viewport::-webkit-scrollbar {
  width: 4px;
}

.page-viewport::-webkit-scrollbar-thumb {
  background: rgba(155, 95, 255, 0.35);
  border-radius: 2px;
}

.crt-screen.is-flickering {
  animation: random-flicker 180ms linear;
}

.crt-screen.is-switching {
  animation: channel-jump 560ms linear;
}

.crt-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(180, 130, 255, 0.09) 0 1px,
    rgba(0, 0, 0, 0.22) 1px 3px
  );
  opacity: 0.4;
  animation: scanline-drift 12s linear infinite;
}

.crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 54%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(120deg, rgba(255, 0, 80, 0.03), rgba(120, 0, 255, 0.025), rgba(0, 60, 255, 0.02));
  animation: crt-flicker 140ms infinite;
  opacity: 0.3;
}

.app {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(155, 95, 255, 0.42);
}

.app button {
  border-radius: 4px;
  border: 1px solid rgba(155, 95, 255, 0.4);
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  color: #dbbeff;
  background: linear-gradient(180deg, rgba(155, 95, 255, 0.12), rgba(155, 95, 255, 0.03));
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.app button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(155, 95, 255, 0.28);
}

.app button:focus,
.app button:focus-visible {
  outline: 2px solid rgba(186, 255, 215, 0.9);
  outline-offset: 2px;
}

.page-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(180, 110, 255, 0.38);
  padding: 2rem 1.5rem;
}

.home-panel {
  gap: 1.2rem;
}

.home-sticker-link {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  z-index: 3;
  display: block;
  transform: rotate(6deg);
  transition: transform 160ms ease, filter 160ms ease;
}

.home-sticker-link:hover {
  transform: rotate(4deg) scale(1.06);
}

.home-sticker {
  width: clamp(100px, 14vw, 170px);
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

/* ── Shop ────────────────────────────────────── */

.shop-panel {
  justify-content: flex-start;
  align-items: center;
  gap: 1.4rem;
  padding-top: 2.5rem;
}

.shop-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.shop-meta {
  margin: 0;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(210, 178, 255, 0.8);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
  width: 100%;
  max-width: 820px;
  padding-bottom: 2rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: rgba(4, 2, 12, 0.92);
  border: 1px solid rgba(155, 95, 255, 0.14);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.product-card:hover {
  border-color: rgba(176, 120, 255, 0.8);
  box-shadow: 0 0 22px rgba(140, 60, 255, 0.13);
}

.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #000;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: saturate(0.7) brightness(0.88);
  transition: filter 200ms ease;
}

.product-card:hover .product-img-wrap img {
  filter: saturate(0.9) brightness(1.02);
}

.product-sold-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 80, 80, 0.9);
  text-shadow: 0 0 12px rgba(255, 60, 60, 0.6);
}

.product-info {
  padding: 0.75rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.product-id {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(196, 160, 255, 0.75);
}

.product-name {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #dbbeff;
  text-shadow: 0 0 8px rgba(180, 110, 255, 0.45);
  text-transform: uppercase;
}

.product-sub {
  margin: 0;
  font-size: 0.54rem;
  letter-spacing: 0.06em;
  color: rgba(196, 160, 255, 0.77);
  text-transform: uppercase;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.product-price {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #dbbeff;
  text-shadow: 0 0 6px rgba(155, 95, 255, 0.45);
}

.product-status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  color: rgba(210, 178, 255, 0.85);
}

.status-dot {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: rgba(155, 95, 255, 0.9);
  box-shadow: 0 0 4px rgba(155, 95, 255, 0.8);
}

.status-dot.sold {
  background: rgba(255, 80, 80, 0.9);
  box-shadow: 0 0 4px rgba(255, 80, 80, 0.7);
}

.product-btn {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.42rem 0.5rem;
  background: transparent;
  border: 1px solid rgba(155, 95, 255, 0.25);
  color: rgba(210, 178, 255, 0.85);
  font-family: inherit;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.product-btn:hover:not(:disabled) {
  background: rgba(155, 95, 255, 0.07);
  border-color: rgba(155, 95, 255, 0.7);
  color: #dbbeff;
}

.product-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.panel-title {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1;
  color: #e2cfff;
  animation: text-flicker 6s ease-in-out infinite;
  text-shadow:
    -1.5px 0 rgba(255, 30, 100, 0.5),
    1.5px 0 rgba(80, 0, 255, 0.5),
    0 0 14px rgba(180, 110, 255, 0.6);
}


.panel-copy {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(0.75rem, 1.6vw, 0.96rem);
  color: rgba(225, 200, 255, 0.92);
}

/* ── Boot sequence ─────────────────────────────── */

.boot-panel {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2.4rem 2rem;
}

.boot-log {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  text-align: left;
  font-size: clamp(0.62rem, 1.4vw, 0.82rem);
  letter-spacing: 0.06em;
  color: rgba(210, 178, 255, 0.82);
}

.boot-line {
  animation: boot-line-in 60ms ease both;
  white-space: pre;
}

.boot-line--blank {
  height: 0.9em;
}

.boot-line--cmd {
  color: #dbbeff;
  text-shadow: 0 0 10px rgba(155, 95, 255, 0.7);
}

.boot-line--warn {
  color: rgba(255, 160, 60, 0.9);
  text-shadow: 0 0 8px rgba(255, 130, 30, 0.5);
}

.gloom-boot-log {
  max-width: 480px;
}

.gloom-boot-log .boot-line {
  color: rgba(220, 55, 65, 0.72);
}

.gloom-boot-log .boot-line--cmd {
  color: rgba(255, 120, 120, 0.95);
  text-shadow: 0 0 10px rgba(220, 55, 65, 0.6);
}

.lore-panel--live {
  animation: lore-archive-in 400ms ease both;
}

@keyframes lore-archive-in {
  from { opacity: 0; filter: brightness(2); }
  to   { opacity: 1; filter: brightness(1); }
}

/* ── Blinking cursor ────────────────────────────── */

.crt-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: rgba(210, 178, 255, 0.85);
  vertical-align: text-bottom;
  margin-left: 0.1em;
  animation: cursor-blink 900ms step-end infinite;
}

/* ── Home panel live (post-boot) ────────────────── */

.home-panel--live {
  animation: screen-on 320ms ease both;
}

.panel-tagline {
  display: flex;
  align-items: center;
  gap: 0;
}

.home-desc {
  font-size: clamp(0.62rem, 1.3vw, 0.78rem);
  color: rgba(210, 178, 255, 0.77);
  max-width: 38ch;
  line-height: 1.8;
  letter-spacing: 0.04em;
}


.channel-static {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 9;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(220, 255, 236, 0.08) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, rgba(0, 0, 0, 0.12) 1px 2px);
}

.channel-static.is-switching {
  animation: static-pop 560ms linear;
}


@keyframes scanline-drift {
  from { background-position-y: 0; }
  to   { background-position-y: 3px; }
}

@keyframes random-flicker {
  0%   { filter: brightness(1);    }
  15%  { filter: brightness(0.45); }
  30%  { filter: brightness(0.92); }
  50%  { filter: brightness(0.2);  }
  65%  { filter: brightness(0.88); }
  80%  { filter: brightness(0.55); }
  100% { filter: brightness(1);    }
}

@keyframes channel-jump {
  /* Phosphor tube overloads as the channel is cut */
  0%   { filter: brightness(1)    saturate(1);   }
  5%   { filter: brightness(8)    saturate(0);   }
  /* Snap to black — electron beam collapses, content invisible */
  14%  { filter: brightness(0.01) saturate(0);   }
  /* Hold black — new content renders at ~53% behind the dark screen */
  51%  { filter: brightness(0.01) saturate(0);   }
  /* New channel locks in: bright dot then quick normalise */
  58%  { filter: brightness(6)    saturate(0);   }
  72%  { filter: brightness(1.15) saturate(0.6); }
  100% { filter: brightness(1)    saturate(1);   }
}

@keyframes static-pop {
  0%   { opacity: 0; }
  8%   { opacity: 0.5; }
  22%  { opacity: 1; }
  52%  { opacity: 0.9; }
  68%  { opacity: 0.2; }
  100% { opacity: 0; }
}

@keyframes crt-flicker {
  0% {
    opacity: 0.24;
  }

  50% {
    opacity: 0.32;
  }

  100% {
    opacity: 0.26;
  }
}

@keyframes boot-line-in {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes screen-on {
  0% {
    opacity: 0;
    filter: brightness(2.4) blur(2px);
  }
  40% {
    opacity: 1;
    filter: brightness(1.3) blur(0px);
  }
  100% {
    opacity: 1;
    filter: brightness(1) blur(0px);
  }
}

@keyframes text-flicker {
  0%, 93%, 96%, 100% { opacity: 1; }
  94% { opacity: 0.82; }
  95% { opacity: 0.94; }
}

/* ── No Signal / 404 ─────────────────────────────── */

.no-signal-panel {
  position: relative;
  overflow: hidden;
  justify-content: center;
}

.no-signal-noise {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(210, 178, 255, 0.06) 0 1px,
      transparent 1px 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(210, 178, 255, 0.03) 0 1px,
      transparent 1px 3px
    );
  animation: noise-shift 0.1s steps(3) infinite;
  opacity: 0.9;
}

.no-signal-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.no-signal-heading {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(226, 207, 255, 0.92);
  text-shadow:
    -1.5px 0 rgba(255, 30, 100, 0.5),
    1.5px 0 rgba(80, 0, 255, 0.5),
    0 0 20px rgba(180, 110, 255, 0.65);
  animation: text-flicker 3s ease-in-out infinite;
}

.no-signal-code {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(210, 178, 255, 0.87);
}

.no-signal-return {
  margin-top: 1.2rem;
  padding: 0.42rem 1rem;
  border: 1px solid rgba(155, 95, 255, 0.3);
  color: rgba(210, 178, 255, 0.85);
  text-decoration: none;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  font-family: inherit;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease;
}

.no-signal-return:hover {
  border-color: rgba(155, 95, 255, 0.85);
  color: #dbbeff;
}

@keyframes noise-shift {
  0%  { background-position: 0 0,      0 0;     }
  33% { background-position: 3px -2px, -2px 4px; }
  66% { background-position: -4px 3px, 5px -1px; }
}

/* ── Blog ───────────────────────────────────────────── */

.blog-panel {
  justify-content: flex-start;
  align-items: center;
  gap: 1.4rem;
  padding-top: 2.5rem;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 700px;
  padding-bottom: 2rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(155, 95, 255, 0.12);
  background: rgba(4, 2, 12, 0.85);
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
}

.blog-card-img-wrap {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.6) brightness(0.85);
  transition: filter 180ms ease, transform 300ms ease;
}

.blog-card:hover .blog-card-img {
  filter: saturate(0.85) brightness(1);
  transform: scale(1.03);
}

.blog-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  flex: 1;
  min-width: 0;
}

.blog-card:hover {
  border-color: rgba(176, 120, 255, 0.74);
  box-shadow: 0 0 18px rgba(140, 60, 255, 0.10);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.blog-card-date {
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: rgba(196, 160, 255, 0.75);
}

.blog-card-title {
  margin: 0;
  font-size: clamp(0.78rem, 2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #dbbeff;
  text-shadow: 0 0 8px rgba(180, 110, 255, 0.38);
  text-transform: uppercase;
}

.blog-card-excerpt {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  color: rgba(210, 178, 255, 0.7);
  line-height: 1.6;
}

.blog-card-read {
  margin-top: 0.3rem;
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: rgba(196, 160, 255, 0.83);
  transition: color 160ms ease;
}

.blog-card:hover .blog-card-read {
  color: rgba(225, 200, 255, 0.92);
}

/* Blog post page */

.blog-post-panel {
  justify-content: flex-start;
  align-items: center;
  padding-top: 2rem;
  gap: 1.2rem;
}

.blog-post-date {
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: rgba(196, 160, 255, 0.75);
}

.blog-post {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
}

.blog-post-title {
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  text-align: left;
  color: #e2cfff;
  text-shadow: 0 0 12px rgba(180, 110, 255, 0.45);
}

.blog-post-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.blog-post-body p {
  margin: 0;
  font-size: clamp(0.62rem, 1.5vw, 0.8rem);
  letter-spacing: 0.05em;
  color: rgba(218, 192, 255, 0.85);
  line-height: 1.75;
}

/* Blog post full image */
.blog-post-img-wrap {
  width: 100%;
  border: 1px solid rgba(155, 95, 255, 0.12);
}

.blog-post-img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.65) brightness(0.9);
}

/* Taller textarea for blog body */
.admin-textarea--tall {
  min-height: 16rem;
}

/* ── Gloomopedia / Lore ─────────────────────────────── */

.lore-panel {
  justify-content: flex-start;
  align-items: center;
  padding: 0.6rem 1.5rem 0;
  /* Override page-panel's min-height sizing so lore-layout can flex-fill */
  min-height: unset;
  flex: 1;
  flex-shrink: 1;
}

.lore-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  width: 100%;
  max-width: 900px;
  border: 1px solid rgba(155, 95, 255, 0.12);
  /* Fill remaining height in the panel's flex column */
  flex: 1;
  min-height: 0;
  /* Grid rows fill the available height */
  grid-template-rows: 1fr;
}

/* ── Index: file card list ── */

.lore-index {
  border-right: 1px solid rgba(155, 95, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  background: rgba(4, 2, 12, 0.5);
}

.lore-index-header {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.22);
  font-size: 0.42rem;
  letter-spacing: 0.16em;
  color: rgba(196, 160, 255, 0.85);
  text-shadow: 0 0 8px rgba(180, 110, 255, 0.25);
  background: rgba(6, 3, 14, 0.7);
  flex-shrink: 0;
}

.lore-index-empty {
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  color: rgba(196, 160, 255, 0.7);
  padding: 0.8rem;
  margin: 0;
}

/* Each entry = a colour-coded file card */
.lore-entry-item {
  padding: 0.55rem 0.8rem 0.55rem 1rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  /* Left stripe in threat colour */
  border-left: 4px solid var(--stripe, rgba(155, 95, 255, 0.2));
  transition: background 120ms ease, border-left-color 120ms ease;
  position: relative;
}

.lore-entry-item:hover {
  background: rgba(155, 95, 255, 0.05);
}

.lore-entry-item--active {
  background: rgba(155, 95, 255, 0.09);
  border-left-color: var(--stripe, rgba(155, 95, 255, 0.6));
  box-shadow: inset 3px 0 12px rgba(155, 95, 255, 0.08);
}

.lore-entry-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lore-entry-num {
  font-size: 0.38rem;
  letter-spacing: 0.14em;
  color: rgba(155, 95, 255, 0.45);
}

.lore-entry-status-pip {
  font-size: 0.42rem;
  line-height: 1;
}

.lore-entry-status-pip--active {
  animation: status-pulse 1.8s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.lore-entry-name {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(210, 178, 255, 0.88);
  line-height: 1.2;
}

.lore-entry-item--active .lore-entry-name {
  color: rgba(230, 200, 255, 0.98);
}

.lore-entry-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.lore-entry-cat {
  font-size: 0.4rem;
  letter-spacing: 0.12em;
  color: rgba(196, 160, 255, 0.62);
}

.lore-entry-threat {
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* ── Detail panel ── */

.lore-detail {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

.lore-back-btn {
  align-self: flex-start;
  margin: 0.7rem 0.7rem 0;
}

.lore-empty-detail {
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  color: rgba(196, 160, 255, 0.55);
  margin: auto;
  align-self: center;
  justify-self: center;
  padding: 2rem;
}

/* ── ACCESS animation ── */

.lore-accessing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 3rem 2rem;
  flex: 1;
}

.lore-accessing-text {
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: rgba(155, 95, 255, 0.85);
  margin: 0;
  animation: text-flicker 1s ease-in-out infinite;
}

.lore-accessing-bar {
  width: 180px;
  height: 2px;
  background: rgba(155, 95, 255, 0.12);
  border: 1px solid rgba(155, 95, 255, 0.22);
  overflow: hidden;
}

.lore-accessing-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(155, 95, 255, 0.6), rgba(210, 178, 255, 0.9));
  box-shadow: 0 0 8px rgba(155, 95, 255, 0.6);
  animation: access-fill 400ms cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes access-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

.lore-accessing-status {
  font-size: 0.4rem;
  letter-spacing: 0.22em;
  color: rgba(155, 95, 255, 0.45);
  margin: 0;
}

/* ── Classified file document ── */

.lore-file-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Phosphor warmup: new file fades in bright then settles */
  animation: lore-file-reveal 300ms ease-out both;
}

@keyframes lore-file-reveal {
  from { opacity: 0; filter: brightness(2.5); }
  to   { opacity: 1; filter: brightness(1);   }
}

/* Classification banner — coloured by threat level */
.lore-classification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1rem;
  background: color-mix(in srgb, var(--tc, rgba(155,95,255,0.65)) 12%, transparent);
  border-bottom: 2px solid var(--tc, rgba(155, 95, 255, 0.4));
  border-top: 1px solid var(--tc, rgba(155, 95, 255, 0.2));
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lore-classification-dept {
  font-size: 0.38rem;
  letter-spacing: 0.16em;
  color: rgba(196, 160, 255, 0.55);
}

.lore-classification-level {
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--tc, rgba(196, 160, 255, 0.85));
  text-shadow: 0 0 12px var(--tc, rgba(155, 95, 255, 0.5));
}

.lore-classification-ref {
  font-size: 0.38rem;
  letter-spacing: 0.14em;
  color: rgba(155, 95, 255, 0.45);
}

/* File title block */
.lore-file-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem 0.75rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.1);
  flex-wrap: wrap;
  background: rgba(12, 6, 24, 0.5);
}

.lore-file-title {
  font-size: clamp(0.9rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e2cfff;
  margin: 0;
  text-shadow: 0 0 18px rgba(180, 110, 255, 0.4);
  flex: 1;
}

/* Metadata table — bordered form fields */
.lore-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid rgba(155, 95, 255, 0.08);
  margin: 0;
}

.lore-field-row {
  display: flex;
  align-items: baseline;
  border-bottom: 1px solid rgba(155, 95, 255, 0.06);
}

.lore-field-row:last-child {
  border-bottom: none;
}

.lore-field-label {
  font-size: 0.4rem;
  letter-spacing: 0.14em;
  color: rgba(155, 95, 255, 0.6);
  min-width: 110px;
  flex-shrink: 0;
  padding: 0.45rem 0.8rem;
  border-right: 1px solid rgba(155, 95, 255, 0.08);
  background: rgba(155, 95, 255, 0.03);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.lore-field-value {
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  color: rgba(218, 190, 255, 0.85);
  padding: 0.45rem 0.8rem;
}

/* Pulsing ACTIVE status */
.lore-status-active {
  animation: status-pulse 1.8s ease-in-out infinite;
}

/* ── Threat bar ── */

.lore-threat-bar {
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
}

.lore-threat-label {
  font-size: 0.42rem;
  letter-spacing: 0.12em;
  color: rgba(210, 178, 255, 0.87);
}

/* ── Image ── */

.lore-image-wrap {
  width: 100%;
  max-width: 400px;
  padding: 0.9rem 1.2rem 0;
}

.lore-image {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.5) brightness(0.82) sepia(0.15);
  border: 1px solid rgba(155, 95, 255, 0.12);
}

/* ── Field notes section ── */

.lore-section-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.2rem 0.4rem;
  font-size: 0.4rem;
  letter-spacing: 0.2em;
  color: rgba(155, 95, 255, 0.55);
}

.lore-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(155, 95, 255, 0.1);
}

.lore-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1.2rem 1.2rem;
  /* Subtle ruled-line background like a research notepad */
  background-image: repeating-linear-gradient(
    180deg,
    transparent,
    transparent calc(1.75em * 0.6rem - 1px),
    rgba(155, 95, 255, 0.04) calc(1.75em * 0.6rem - 1px),
    rgba(155, 95, 255, 0.04) calc(1.75em * 0.6rem)
  );
}

.lore-body p {
  font-size: 0.6rem;
  line-height: 1.75;
  color: rgba(218, 190, 255, 0.85);
  letter-spacing: 0.03em;
  margin: 0;
}

/* ── Admin actions ── */

.lore-admin-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid rgba(155, 95, 255, 0.08);
}

/* ── Corrupted file entries ─────────────────────────── */

.lore-entry-item--corrupted .lore-entry-name {
  color: rgba(255, 80, 80, 0.75);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.lore-classification-banner--corrupted {
  background: rgba(255, 40, 40, 0.12);
  border-bottom-color: rgba(255, 40, 40, 0.55);
  border-top-color:    rgba(255, 40, 40, 0.25);
  animation: corrupted-banner-pulse 2s ease-in-out infinite;
}

@keyframes corrupted-banner-pulse {
  0%, 100% { border-bottom-color: rgba(255, 40, 40, 0.55); }
  50%       { border-bottom-color: rgba(255, 40, 40, 0.18); }
}

.lore-classification-level--corrupted {
  color: rgba(255, 80, 80, 0.9);
  text-shadow: 0 0 12px rgba(255, 40, 40, 0.5);
}

.lore-file-title--corrupted {
  color: rgba(255, 80, 80, 0.55);
  letter-spacing: 0.02em;
}

.lore-field-corrupted {
  color: rgba(255, 80, 80, 0.65) !important;
  font-style: italic;
}

.lore-body--corrupted p {
  color: rgba(255, 80, 80, 0.45);
  letter-spacing: 0.02em;
}

.lore-corrupted-notice {
  color: rgba(255, 80, 80, 0.7) !important;
  letter-spacing: 0.1em !important;
  font-size: 0.46rem !important;
}

/* Periodic glitch on the corrupted view */
.lore-corrupted-view {
  animation: lore-file-reveal 300ms ease-out both, corrupt-glitch 5s 1s ease-in-out infinite;
}

@keyframes corrupt-glitch {
  0%, 84%, 100% { transform: translateX(0);    filter: brightness(1); }
  86%            { transform: translateX(-4px); filter: brightness(1.5) hue-rotate(12deg); }
  88%            { transform: translateX(3px);  filter: brightness(0.7); }
  90%            { transform: translateX(-1px); filter: brightness(1.3); }
  92%            { transform: translateX(0);    filter: brightness(1); }
}

/* ── Lore: Category Landing ─────────────────────────── */

.lore-cat-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.4rem 2rem;
  gap: 0.9rem;
  text-align: center;
  flex: 1;
  animation: lore-file-reveal 500ms ease both;
}

.lore-cat-glyph {
  font-size: 3.2rem;
  color: rgba(155, 95, 255, 0.55);
  line-height: 1;
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 0 22px rgba(155, 95, 255, 0.5));
  animation: text-flicker 4s ease-in-out infinite;
}

.lore-cat-heading {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: rgba(219, 190, 255, 0.95);
  text-shadow: 0 0 16px rgba(155, 95, 255, 0.5);
}

.lore-cat-sub {
  font-size: 0.44rem;
  letter-spacing: 0.15em;
  color: rgba(155, 95, 255, 0.6);
}

.lore-cat-divider {
  width: 60%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(155, 95, 255, 0.25), transparent);
  margin: 0.2rem 0;
}

.lore-cat-body {
  max-width: 380px;
  font-size: 0.5rem;
  line-height: 1.85;
  letter-spacing: 0.05em;
  color: rgba(196, 160, 255, 0.78);
  text-align: left;
}

.lore-cat-body p {
  margin: 0 0 0.7em;
}

.lore-cat-meta {
  font-size: 0.4rem;
  letter-spacing: 0.18em;
  color: rgba(155, 95, 255, 0.45);
}

.lore-cat-browse-btn {
  margin-top: 0.4rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.44rem;
  letter-spacing: 0.18em;
  color: rgba(219, 190, 255, 0.9);
  background: rgba(155, 95, 255, 0.08);
  border: 1px solid rgba(155, 95, 255, 0.25);
  cursor: pointer;
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}

.lore-cat-browse-btn:hover {
  background: rgba(155, 95, 255, 0.16);
  border-color: rgba(155, 95, 255, 0.5);
  box-shadow: 0 0 14px rgba(155, 95, 255, 0.2);
}

/* ── Lore: Navigation footer ─────────────────────────── */

.lore-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  margin-top: auto;
  border-top: 1px solid rgba(155, 95, 255, 0.1);
  flex-shrink: 0;
}

.lore-nav-btn {
  font-size: 0.4rem;
  letter-spacing: 0.14em;
  padding: 0.38rem 0.7rem;
  color: rgba(196, 160, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(155, 95, 255, 0.14);
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
  flex-shrink: 0;
}

.lore-nav-btn:hover:not(:disabled) {
  color: rgba(219, 190, 255, 0.95);
  border-color: rgba(155, 95, 255, 0.4);
  background: rgba(155, 95, 255, 0.08);
}

.lore-nav-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.lore-nav-btn--random {
  color: rgba(155, 95, 255, 0.75);
  border-color: rgba(155, 95, 255, 0.2);
}

.lore-nav-btn--random:hover {
  color: rgba(219, 190, 255, 1) !important;
  background: rgba(155, 95, 255, 0.12) !important;
  box-shadow: 0 0 10px rgba(155, 95, 255, 0.2);
}

/* ── Pixel Art Generator ────────────────────────────── */

.pixel-art-generator {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid rgba(155, 95, 255, 0.1);
  padding: 0.6rem;
}

.pixel-art-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pixel-art-status {
  font-size: 0.42rem;
  letter-spacing: 0.14em;
  color: rgba(155, 95, 255, 0.7);
  animation: text-flicker 1.5s ease-in-out infinite;
}

.pixel-art-status--ok {
  color: rgba(120, 255, 172, 0.85);
  animation: none;
}

.pixel-art-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.pixel-art-img {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
  border: 1px solid rgba(155, 95, 255, 0.2);
}

.pixel-art-actions {
  display: flex;
  gap: 0.4rem;
}

/* ── Comments ───────────────────────────────────────── */

.comments-section {
  width: 100%;
  max-width: 700px;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(155, 95, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.comments-heading {
  font-size: 0.48rem;
  letter-spacing: 0.18em;
  color: rgba(155, 95, 255, 0.62);
  margin: 0 0 0.2rem;
}

.comments-count {
  color: rgba(210, 178, 255, 0.7);
}

.comment-card {
  background: rgba(4, 10, 6, 0.55);
  border: 1px solid rgba(155, 95, 255, 0.1);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.comment-card--pending {
  border-color: rgba(255, 180, 50, 0.48);
  opacity: 0.8;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.comment-author {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(210, 178, 255, 0.87);
}

.comment-date {
  font-size: 0.44rem;
  letter-spacing: 0.07em;
  color: rgba(196, 160, 255, 0.75);
}

.comment-pending-badge {
  font-size: 0.42rem;
  letter-spacing: 0.12em;
  color: rgba(255, 180, 50, 0.8);
  border: 1px solid rgba(255, 180, 50, 0.22);
  padding: 0.1rem 0.35rem;
}

.comment-body {
  font-size: 0.6rem;
  line-height: 1.7;
  color: rgba(210, 178, 255, 0.82);
  letter-spacing: 0.03em;
  margin: 0;
}

.comment-mod-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.comment-empty {
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  color: rgba(196, 160, 255, 0.73);
  margin: 0;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.comment-form-textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.comment-pending-notice {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(255, 180, 50, 0.8);
  border: 1px solid rgba(255, 180, 50, 0.18);
  padding: 0.55rem 0.8rem;
  margin: 0;
}

.comment-login-prompt {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(210, 178, 255, 0.83);
  margin: 0;
}

.comment-login-link {
  color: rgba(210, 178, 255, 0.88);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.comment-login-link:hover {
  color: rgba(210, 178, 255, 0.9);
}

/* ── Admin pending comments ─────────────────────────── */

.admin-pending-comments {
  width: 100%;
  max-width: 900px;
  margin-bottom: 1rem;
}

.admin-comment-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(255, 180, 50, 0.15);
  background: rgba(6, 3, 14, 0.55);
  margin-bottom: 0.4rem;
}

.admin-comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-comment-author {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(210, 178, 255, 0.8);
}

.admin-comment-post {
  font-size: 0.44rem;
  letter-spacing: 0.08em;
  color: rgba(196, 160, 255, 0.77);
}

.admin-comment-body {
  font-size: 0.54rem;
  line-height: 1.55;
  color: rgba(210, 178, 255, 0.9);
  margin: 0;
}

.admin-comment-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

/* ── Product card link ──────────────────────────────── */

.product-card--link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

/* ── Product detail page ─────────────────────────────── */

/* ── Product page — mobile-first layout ──────────────── */

.product-page {
  padding: 0;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  text-align: left;
}

.product-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.1);
  flex-shrink: 0;
  gap: 0.6rem;
}

/* Mobile: image on top, content below */
.product-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

.product-img-area {
  width: 100%;
  flex-shrink: 0;
}

.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: saturate(0.7) brightness(0.9);
}

/* Tabs */
.product-content-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid rgba(155, 95, 255, 0.1);
}

.product-tab-strip {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(155, 95, 255, 0.1);
}

.product-tab {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(155, 95, 255, 0.08);
  color: rgba(196, 160, 255, 0.87);
  font-family: inherit;
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.product-tab:last-child {
  border-right: none;
}

.product-tab--active {
  color: rgba(210, 178, 255, 0.9);
  background: rgba(155, 95, 255, 0.04);
  box-shadow: inset 0 -2px 0 rgba(155, 95, 255, 0.5);
}

.product-tab:hover:not(.product-tab--active) {
  color: rgba(210, 178, 255, 0.88);
  background: rgba(155, 95, 255, 0.04);
}

.product-tab--closed {
  color: rgba(255, 80, 80, 0.9);
}

.product-tab--owner {
  color: rgba(255, 200, 80, 0.85);
}

.product-tab--owner.product-tab--active {
  color: rgba(255, 220, 120, 0.95);
  box-shadow: inset 0 -2px 0 rgba(255, 200, 80, 0.6);
}

/* Shared tab body */
.product-tab-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 95, 255, 0.45) transparent;
}

/* Catalog tab */
.product-catalog-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.2rem 1rem;
}

.product-page-title {
  margin: 0;
  font-size: clamp(1.1rem, 5vw, 1.8rem);
  line-height: 1.1;
  color: #e2cfff;
  animation: text-flicker 6s ease-in-out infinite;
  text-shadow:
    0 0 8px rgba(180, 110, 255, 0.65),
    0 0 22px rgba(150, 70, 255, 0.28);
}

.product-page-desc {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: rgba(218, 190, 255, 0.82);
  line-height: 1.75;
}

.product-page-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.product-page-acquire {
  width: 100%;
  padding: 0.6rem 0.5rem;
  font-size: 0.56rem;
}

.product-page-note {
  margin: 0;
  font-size: 0.46rem;
  letter-spacing: 0.07em;
  color: rgba(210, 178, 255, 0.75);
  line-height: 1.75;
}

.product-channel-hint {
  background: transparent;
  border: none;
  color: rgba(196, 160, 255, 0.87);
  font-family: inherit;
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color 140ms ease;
}

.product-channel-hint:hover {
  color: rgba(225, 200, 255, 0.95);
}

/* Channel tab */
.product-channel-body {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.channel-auth-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.4rem 1rem;
}

.channel-auth-label {
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  color: rgba(196, 160, 255, 0.87);
  margin: 0;
}

.channel-auth-sub {
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  color: rgba(210, 178, 255, 0.87);
  line-height: 1.75;
  margin: 0;
}

.channel-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.08);
  flex-shrink: 0;
  gap: 0.8rem;
}

.channel-status-label {
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  color: rgba(196, 160, 255, 0.77);
}

.channel-status-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.channel-resumed {
  font-size: 0.38rem;
  letter-spacing: 0.12em;
  color: rgba(196, 160, 255, 0.73);
  white-space: nowrap;
}

.channel-observers {
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  color: rgba(196, 160, 255, 0.7);
  white-space: nowrap;
}

.channel-counter {
  font-size: 0.4rem;
  letter-spacing: 0.1em;
  color: rgba(196, 160, 255, 0.7);
  white-space: nowrap;
}

.channel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 200px;
  max-height: 44vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 95, 255, 0.45) transparent;
}

.channel-connecting {
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: rgba(196, 160, 255, 0.85);
  margin: 0;
  animation: channel-blink 1s ease infinite;
}

@keyframes channel-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.channel-message {
  font-size: 0.54rem;
  letter-spacing: 0.05em;
  line-height: 1.8;
}

.channel-message--creature {
  color: rgba(218, 190, 255, 0.88);
  text-shadow: 0 0 10px rgba(180, 110, 255, 0.18);
}

/* Streaming cursor on the last creature message while text is arriving */
.channel-message--streaming::after {
  content: "▋";
  display: inline;
  color: rgba(196, 148, 255, 0.85);
  animation: channel-blink 0.7s ease infinite;
  margin-left: 1px;
}

.channel-message--user {
  color: rgba(196, 160, 255, 0.8);
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
}

.channel-thinking {
  opacity: 0.4;
  animation: channel-blink 0.9s ease infinite;
}

.channel-prompt {
  color: rgba(196, 160, 255, 0.8);
  flex-shrink: 0;
  font-size: 0.5rem;
}

.channel-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid rgba(155, 95, 255, 0.08);
  flex-shrink: 0;
}

.channel-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.54rem;
  letter-spacing: 0.07em;
  color: rgba(210, 178, 255, 0.85);
  caret-color: #9b5fff;
}

.channel-input::placeholder {
  color: rgba(196, 160, 255, 0.72);
}

.channel-send-btn {
  background: transparent;
  border: 1px solid rgba(155, 95, 255, 0.4);
  color: rgba(196, 160, 255, 0.87);
  font-family: inherit;
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.channel-send-btn:hover:not(:disabled) {
  background: rgba(155, 95, 255, 0.06);
  color: rgba(210, 178, 255, 0.85);
}

.channel-send-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Desktop: side-by-side */
@media (min-width: 780px) {
  .product-page {
    height: 100%;
  }

  .product-layout {
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  .product-img-area {
    width: 42%;
    flex-shrink: 0;
    position: relative;
  }

  .product-img-wrap {
    position: absolute;
    inset: 0;
    aspect-ratio: unset;
    height: 100%;
    border-right: 1px solid rgba(155, 95, 255, 0.1);
  }

  .product-content-area {
    border-top: none;
    border-left: none;
    flex: 1;
    min-width: 0;
  }

  .channel-messages {
    max-height: none;
    flex: 1;
  }

  .product-channel-body {
    height: 100%;
  }
}

/* ── Right-side auth tab ──────────────────────────────── */

.cabinet-menu-right {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  padding-left: 4px;
  border-left: 1px solid rgba(155, 95, 255, 0.14);
  position: relative;
  z-index: 1;
}


/* ── Admin / Auth shared ─────────────────────────────── */

.admin-panel {
  justify-content: flex-start;
  align-items: center;
  gap: 0;
  padding-top: 2rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.12);
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-title {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.72rem;
  border: 1px solid rgba(155, 95, 255, 0.3);
  background: transparent;
  color: rgba(210, 178, 255, 0.85);
  font-family: inherit;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.admin-btn:hover {
  background: rgba(155, 95, 255, 0.07);
  border-color: rgba(155, 95, 255, 0.7);
  color: #dbbeff;
}

.admin-btn--add {
  border-color: rgba(155, 95, 255, 0.75);
  color: rgba(210, 178, 255, 0.85);
}

.admin-btn--logout {
  border-color: rgba(255, 80, 80, 0.6);
  color: rgba(255, 150, 150, 0.75);
}

.admin-btn--logout:hover {
  background: rgba(255, 80, 80, 0.06);
  border-color: rgba(255, 80, 80, 0.7);
  color: rgba(255, 140, 140, 0.9);
}

.admin-btn--save {
  width: 100%;
  max-width: 360px;
  padding: 0.5rem 1rem;
  font-size: 0.58rem;
  align-self: center;
  margin-top: 0.4rem;
}

/* Product list */

.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 900px;
}

.admin-product-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(155, 95, 255, 0.1);
  background: rgba(4, 2, 12, 0.8);
}

.admin-product-row--sold {
  opacity: 0.55;
}

.admin-product-thumb-wrap {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
}

.admin-product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-thumb-empty {
  background: rgba(155, 95, 255, 0.04);
  border: 1px solid rgba(155, 95, 255, 0.08);
}

.admin-product-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.admin-product-sku {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(196, 160, 255, 0.77);
  white-space: nowrap;
}

.admin-product-name {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #dbbeff;
  text-shadow: 0 0 8px rgba(155, 95, 255, 0.28);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-product-price {
  font-size: 0.56rem;
  color: rgba(210, 178, 255, 0.9);
}

.admin-product-status {
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.38rem;
  border: 1px solid;
}

.admin-product-status.available {
  border-color: rgba(155, 95, 255, 0.6);
  color: rgba(155, 95, 255, 0.85);
}

.admin-product-status.sold {
  border-color: rgba(255, 80, 80, 0.6);
  color: rgba(255, 100, 100, 0.8);
}

.admin-enquiry-badge {
  font-size: 0.46rem;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.38rem;
  background: rgba(255, 200, 80, 0.06);
  border: 1px solid rgba(255, 200, 80, 0.28);
  color: rgba(255, 220, 120, 0.9);
  white-space: nowrap;
}

.admin-product-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  align-items: center;
}

.admin-action-btn {
  padding: 0.22rem 0.54rem;
  border: 1px solid rgba(155, 95, 255, 0.22);
  background: transparent;
  color: rgba(210, 178, 255, 0.7);
  font-family: inherit;
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.admin-action-btn:hover {
  background: rgba(155, 95, 255, 0.07);
  border-color: rgba(155, 95, 255, 0.8);
  color: #dbbeff;
}

.admin-action-btn--delete {
  border-color: rgba(255, 80, 80, 0.5);
  color: rgba(255, 100, 100, 0.8);
}

.admin-action-btn--delete:hover {
  background: rgba(255, 80, 80, 0.06);
  border-color: rgba(255, 80, 80, 0.78);
  color: rgba(255, 120, 120, 0.85);
}

/* Login */

.admin-login-panel {
  justify-content: center;
}

.login-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
  align-items: center;
}

.login-title {
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  text-align: center;
}

.login-mode-toggle {
  display: flex;
  width: 100%;
  border: 1px solid rgba(155, 95, 255, 0.18);
}

.login-mode-btn {
  flex: 1;
  padding: 0.36rem 0.5rem;
  background: transparent;
  border: none;
  color: rgba(210, 178, 255, 0.7);
  font-family: inherit;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.login-mode-btn.active {
  background: rgba(155, 95, 255, 0.1);
  color: rgba(210, 178, 255, 0.85);
}

.login-mode-btn:hover:not(.active) {
  background: rgba(155, 95, 255, 0.04);
  color: rgba(210, 178, 255, 0.7);
}

/* Admin form */

.admin-login-form,
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.admin-form {
  gap: 1rem;
  max-width: 700px;
}

.admin-form-cols {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-form-image-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  flex: 0 0 auto;
}

.admin-image-preview {
  width: 160px;
  height: 160px;
  border: 1px solid rgba(155, 95, 255, 0.16);
  background: rgba(4, 2, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-image-placeholder {
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  color: rgba(155, 95, 255, 0.52);
}

.admin-upload-btn {
  display: block;
  width: 160px;
  padding: 0.28rem 0.6rem;
  border: 1px dashed rgba(155, 95, 255, 0.22);
  color: rgba(210, 178, 255, 0.75);
  font-family: inherit;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 140ms ease, color 140ms ease;
}

.admin-upload-btn:hover {
  border-color: rgba(155, 95, 255, 0.78);
  color: rgba(210, 178, 255, 0.9);
}

.admin-image-preview--wide {
  width: 220px;
  height: 160px;
}

.admin-upload-btn--wide {
  width: 220px;
}

.admin-form-fields-col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
  min-width: 220px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}

.admin-label {
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: rgba(196, 160, 255, 0.83);
}

.admin-input {
  background: rgba(4, 2, 12, 0.9);
  border: 1px solid rgba(155, 95, 255, 0.18);
  color: rgba(210, 178, 255, 0.82);
  font-family: inherit;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 0.38rem 0.55rem;
  outline: none;
  transition: border-color 140ms ease;
  width: 100%;
}

.admin-input:focus {
  border-color: rgba(155, 95, 255, 0.78);
}

.admin-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.admin-toggle {
  padding: 0.28rem 0.64rem;
  border: 1px solid;
  background: transparent;
  font-family: inherit;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 140ms ease;
}

.admin-toggle--on {
  border-color: rgba(155, 95, 255, 0.68);
  color: rgba(155, 95, 255, 0.9);
}

.admin-toggle--on:hover {
  background: rgba(155, 95, 255, 0.06);
}

.admin-toggle--off {
  border-color: rgba(255, 80, 80, 0.62);
  color: rgba(255, 100, 100, 0.8);
}

.admin-toggle--off:hover {
  background: rgba(255, 80, 80, 0.05);
}

.admin-error {
  margin: 0;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: rgba(255, 100, 100, 0.82);
  text-shadow: 0 0 8px rgba(255, 60, 60, 0.35);
}

.admin-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.48rem;
  color: rgba(210, 178, 255, 0.75);
  width: 160px;
}

.admin-progress-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(155, 95, 255, 0.08);
  border: 1px solid rgba(155, 95, 255, 0.18);
}

.admin-progress-bar {
  height: 100%;
  background: rgba(155, 95, 255, 0.65);
  transition: width 200ms ease;
}

/* ── Wishlist button ─────────────────────────────────── */

.wishlist-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 5;
  background: rgba(6, 3, 14, 0.82);
  border: 1px solid rgba(155, 95, 255, 0.15);
  color: rgba(155, 95, 255, 0.62);
  font-size: 0.85rem;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.wishlist-btn:hover {
  color: rgba(255, 90, 90, 0.93);
  border-color: rgba(255, 90, 90, 0.62);
  background: rgba(6, 3, 14, 0.92);
}

.wishlist-btn--active {
  color: rgba(255, 70, 70, 0.9);
  border-color: rgba(255, 70, 70, 0.68);
}

.wishlist-btn--active:hover {
  color: rgba(155, 95, 255, 0.75);
  border-color: rgba(155, 95, 255, 0.5);
}

/* Inline variant on product detail page */
.wishlist-btn--inline {
  position: static;
  width: auto;
  height: auto;
  padding: 0.32rem 0.9rem;
  font-size: 0.52rem;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* ── Account page ─────────────────────────────────────── */

.account-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 700px;
  padding: 1rem 0;
  border-top: 1px solid rgba(155, 95, 255, 0.08);
}

.account-section-label {
  font-size: 0.44rem;
  letter-spacing: 0.18em;
  color: rgba(196, 160, 255, 0.9);
  text-shadow: 0 0 8px rgba(180, 110, 255, 0.25);
  margin-bottom: 0.25rem;
}

/* ── Filter chips ─────────────────────────────────────── */

.filter-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
  max-width: 820px;
  width: 100%;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 0.22rem 0.65rem;
  border: 1px solid rgba(155, 95, 255, 0.2);
  background: transparent;
  color: rgba(210, 178, 255, 0.75);
  font-family: inherit;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: rgba(155, 95, 255, 0.06);
  border-color: rgba(155, 95, 255, 0.75);
  color: rgba(210, 178, 255, 0.9);
}

.filter-chip--active {
  border-color: rgba(155, 95, 255, 0.7);
  background: rgba(155, 95, 255, 0.08);
  color: #dbbeff;
  text-shadow: 0 0 8px rgba(155, 95, 255, 0.4);
}

/* ── Product card admin overlay ───────────────────────── */

.product-card-wrap {
  position: relative;
  height: 100%;
}

.product-card {
  height: 100%;
}

.admin-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0;
  z-index: 4;
  pointer-events: auto;
}

.admin-card-btn {
  flex: 1;
  padding: 0.28rem 0.4rem;
  border: none;
  border-bottom: 1px solid rgba(155, 95, 255, 0.18);
  background: rgba(4, 2, 12, 0.88);
  color: rgba(210, 178, 255, 0.75);
  font-family: inherit;
  font-size: 0.44rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.admin-card-btn:hover {
  background: rgba(155, 95, 255, 0.1);
  color: #dbbeff;
}

.admin-card-btn--delete {
  border-left: 1px solid rgba(155, 95, 255, 0.1);
  color: rgba(255, 100, 100, 0.8);
}

.admin-card-btn--delete:hover {
  background: rgba(255, 60, 60, 0.08);
  color: rgba(255, 130, 130, 0.9);
}

/* ── Blog card admin overlay ──────────────────────────── */

.blog-card-wrap {
  position: relative;
  width: 100%;
}

.blog-card-wrap .blog-card {
  width: 100%;
}

/* ── Draft badge ──────────────────────────────────────── */

.draft-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.38rem;
  background: rgba(255, 200, 60, 0.08);
  border: 1px solid rgba(255, 200, 60, 0.35);
  color: rgba(255, 220, 100, 0.93);
  font-size: 0.42rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Blog card tags ───────────────────────────────────── */

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.2rem;
}

.blog-tag {
  padding: 0.1rem 0.38rem;
  border: 1px solid rgba(155, 95, 255, 0.18);
  color: rgba(155, 95, 255, 0.75);
  font-size: 0.42rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Admin form helpers ───────────────────────────────── */

.admin-input-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.admin-hint {
  margin-left: 0.5rem;
  font-size: 0.42rem;
  letter-spacing: 0.08em;
  color: rgba(155, 95, 255, 0.55);
  text-transform: none;
  font-weight: 400;
}

/* ── Contact page ─────────────────────────────────────── */

.contact-panel {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  padding: 1.6rem 1.2rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.contact-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-section-label {
  font-size: 0.48rem;
  letter-spacing: 0.2em;
  color: rgba(196, 160, 255, 0.93);
  text-shadow: 0 0 8px rgba(180, 110, 255, 0.28);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.28);
}

.contact-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-field-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.contact-field-label {
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  color: rgba(196, 160, 255, 0.77);
  min-width: 6rem;
  flex-shrink: 0;
}

.contact-field-value {
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  color: rgba(210, 178, 255, 0.9);
}

.contact-link {
  text-decoration: none;
  transition: color 0.15s;
}

.contact-link:hover {
  color: #9b5fff;
}

.contact-note {
  font-size: 0.46rem;
  letter-spacing: 0.08em;
  color: rgba(155, 95, 255, 0.58);
  line-height: 1.7;
  margin: 0;
}

/* ── Newsletter ───────────────────────────────────────── */

.newsletter-desc {
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: rgba(210, 178, 255, 0.75);
  line-height: 1.8;
  margin: 0;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.newsletter-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(155, 95, 255, 0.2);
  padding-bottom: 0.3rem;
}

.newsletter-prompt {
  font-size: 0.6rem;
  color: rgba(155, 95, 255, 0.7);
  flex-shrink: 0;
}

.newsletter-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  color: #dbbeff;
  caret-color: #9b5fff;
  width: 100%;
}

.newsletter-input::placeholder {
  color: rgba(155, 95, 255, 0.5);
}

.newsletter-btn {
  align-self: flex-start;
}

.newsletter-success {
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: rgba(155, 95, 255, 0.7);
  margin: 0;
  line-height: 1.8;
}

.newsletter-email {
  color: #9b5fff;
  font-size: 0.52rem;
}

/* ── Admin subscribers panel ──────────────────────────── */

.admin-subscribers {
  width: 100%;
  max-width: 900px;
  margin-top: 1.4rem;
}

.admin-subscriber-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(155, 95, 255, 0.06);
}

.admin-subscriber-email {
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  color: rgba(210, 178, 255, 0.85);
  flex: 1;
}

.admin-subscriber-date {
  font-size: 0.44rem;
  letter-spacing: 0.08em;
  color: rgba(155, 95, 255, 0.6);
  white-space: nowrap;
}

.admin-subscriber-actions {
  display: flex;
  gap: 0.4rem;
}

.admin-copy-btn {
  align-self: flex-start;
  margin-bottom: 0.6rem;
}

/* ── Cart nav indicator ───────────────────────────────── */

.cabinet-tag.has-items {
  --tc: 245, 200, 50;
}

.cabinet-tag.has-items.is-active {
  background: linear-gradient(180deg, #1e1a0a, #15120a);
}

/* ── Cart page ────────────────────────────────────────── */

.cart-page {
  max-width: 680px;
}

.cart-empty {
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1rem 0;
  border-top: 1px solid rgba(155, 95, 255, 0.1);
}

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(155, 95, 255, 0.1);
}

.cart-item--sold {
  opacity: 0.5;
}

.cart-item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cart-item-sku {
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  color: rgba(155, 95, 255, 0.7);
  margin: 0;
}

.cart-item-name {
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  color: #dbbeff;
  margin: 0;
}

.cart-item-unavailable {
  font-size: 0.42rem;
  letter-spacing: 0.12em;
  color: #f5c842;
  margin: 0;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.cart-item-price {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: #9b5fff;
  margin: 0;
}

.cart-remove-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.4rem;
  letter-spacing: 0.14em;
  color: rgba(155, 95, 255, 0.6);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.cart-remove-btn:hover {
  color: #f5c842;
}

.cart-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.8rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(155, 95, 255, 0.15);
  border-bottom: 1px solid rgba(155, 95, 255, 0.15);
  margin-bottom: 0.4rem;
}

.cart-total-label {
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: rgba(155, 95, 255, 0.8);
}

.cart-total-amount {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #9b5fff;
}

.cart-checkout-btn {
  max-width: 300px;
}

.cart-note {
  font-size: 0.42rem;
  letter-spacing: 0.08em;
  color: rgba(155, 95, 255, 0.55);
  margin: 0.2rem 0 0;
}

/* ── Orders / acquired specimens ──────────────────────── */

.order-pending-banner {
  border: 1px solid rgba(245, 200, 66, 0.3);
  background: rgba(245, 200, 66, 0.04);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.order-pending-label {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: #f5c842;
  margin: 0 0 0.25rem;
}

.order-pending-sub {
  font-size: 0.44rem;
  letter-spacing: 0.08em;
  color: rgba(245, 200, 66, 0.7);
  margin: 0;
  line-height: 1.6;
}

.order-row {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(155, 95, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-row-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.order-status {
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.4rem;
  border: 1px solid currentColor;
}

.order-status--paid {
  color: #9b5fff;
  border-color: rgba(155, 95, 255, 0.7);
}

.order-status--pending {
  color: #f5c842;
  border-color: rgba(245, 200, 66, 0.7);
}

.order-date {
  font-size: 0.44rem;
  letter-spacing: 0.1em;
  color: rgba(155, 95, 255, 0.6);
}

.order-total {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(155, 95, 255, 0.75);
  margin-left: auto;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.order-item-sku {
  font-size: 0.42rem;
  letter-spacing: 0.12em;
  color: rgba(155, 95, 255, 0.65);
  flex-shrink: 0;
}

.order-item-name {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: #dbbeff;
  flex: 1;
}

/* ── Admin QR section ─────────────────────────────────── */

.admin-qr-section {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(155, 95, 255, 0.12);
}

.admin-qr-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1rem;
}

.admin-qr-img {
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
  border: 2px solid rgba(155, 95, 255, 0.25);
}

.admin-qr-url {
  font-size: 0.42rem;
  letter-spacing: 0.06em;
  color: rgba(155, 95, 255, 0.75);
  word-break: break-all;
  max-width: 380px;
  margin: 0;
}

/* ── Claim page ───────────────────────────────────────── */

.claim-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 60vh;
}

.claim-terminal {
  width: min(520px, 100%);
  border: 1px solid rgba(155, 95, 255, 0.2);
  padding: 1.4rem 1.6rem 1.6rem;
  background: rgba(2, 0, 14, 0.5);
}

.claim-header {
  font-size: 0.48rem;
  letter-spacing: 0.2em;
  color: rgba(155, 95, 255, 0.65);
  margin: 0 0 1.4rem;
}

.claim-block {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.claim-line {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: #c9a6ff;
  margin: 0;
}

.claim-sub {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(210, 178, 255, 0.8);
  margin: 0;
  line-height: 1.7;
}

.claim-token {
  color: #f5c842;
  letter-spacing: 0.12em;
}

.claim-step {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  margin: 0;
  line-height: 1.8;
}

.claim-step--done {
  color: rgba(155, 95, 255, 0.7);
}

.claim-step--active {
  color: #c9a6ff;
}

.claim-step--active::after {
  content: "▋";
  animation: cursor-blink 0.9s step-end infinite;
  margin-left: 0.2em;
}

.claim-success {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: #c9a6ff;
  margin: 0.4rem 0 0;
}

.claim-error {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: #f5c842;
  margin: 0;
}

.claim-action-btn {
  margin-top: 0.6rem;
  align-self: flex-start;
}

/* ── Mobile hamburger & fullscreen nav ────────────────── */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 0.55rem;
  flex-shrink: 0;
  height: 100%;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(var(--mb, 155, 95, 255), 0.70);
  transition: background 200ms ease;
}

.nav-hamburger:hover span {
  background: rgba(var(--mb, 155, 95, 255), 1);
}

.nav-mobile-brand {
  display: none;
  flex: 1;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  cursor: pointer;
}

.nav-mobile-cursor {
  display: inline-block;
  flex-shrink: 0;
  width: 0.48rem;
  height: 0.9em;
  background: #9b5fff;
  box-shadow: 0 0 6px rgba(155, 95, 255, 0.95), 0 0 16px rgba(155, 95, 255, 0.45);
  animation: nav-cursor-blink 0.72s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes nav-cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* Nav brand label colour — matches the menu item for the current page */
.brand--home    { --mb: 155,  95, 255; }
.brand--shop    { --mb: 110, 220,  80; }
.brand--gloom   { --mb: 220,  55,  65; }
.brand--blog    { --mb: 190,  90, 255; }
.brand--contact { --mb:  60, 200, 220; }
.brand--cart    { --mb: 245, 200,  50; }
.brand--account { --mb: 180, 130, 255; }
.brand--login   { --mb: 180, 130, 255; }
.brand--admin   { --mb: 255, 140,  50; }

.nav-mobile-page {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: rgba(var(--mb, 210, 178, 255), 0.88);
  text-shadow: 0 0 10px rgba(var(--mb, 155, 95, 255), 0.50);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 200ms ease, text-shadow 200ms ease;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Filing cabinet drawer — mobile menu ───────────────── */

.mobile-menu {
  position: fixed;
  /* Starts just below the nav bar — the drawer opens beneath the cabinet top */
  top: 2.6rem;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Drawer interior: dark metal floor with faint horizontal ridges */
  background:
    repeating-linear-gradient(
      180deg,
      transparent                      0px,
      transparent                      3px,
      rgba(155, 95, 255, 0.016)        3px,
      rgba(155, 95, 255, 0.016)        4px
    ),
    linear-gradient(180deg, #0f0b1e 0%, #090714 100%);
  /* Drawer slides in from the left — mechanical spring with hard stop */
  animation: drawer-open 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes drawer-open {
  from { opacity: 0.5; transform: translateX(-100%); }
  82%  {               transform: translateX(6px);   }  /* overshoot — hits the stop */
  100% { opacity: 1;   transform: translateX(0); }
}

@keyframes drawer-close {
  from { opacity: 1;   transform: translateX(0); }
  to   { opacity: 0.6; transform: translateX(-100%); }
}

.mobile-menu--closing {
  animation: drawer-close 280ms cubic-bezier(0.55, 0, 0.78, 0) both;
}

/* Drawer label holder — the inset label panel on the front of the drawer */
.mobile-menu-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1a1230 0%, #120e26 100%);
  border-bottom: 2px solid rgba(155, 95, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 3px 10px rgba(0, 0, 0, 0.5);
}

.mobile-menu-title {
  font-size: 0.46rem;
  letter-spacing: 0.28em;
  color: rgba(155, 95, 255, 0.55);
  margin: 0;
  text-transform: uppercase;
  cursor: pointer;
  flex: 1;
  transition: color 140ms ease;
}

.mobile-menu-title:hover {
  color: rgba(155, 95, 255, 0.85);
}

/* Tap-to-close hint on the right */
.mobile-menu-header::after {
  content: "TAP TO CLOSE";
  font-size: 0.38rem;
  letter-spacing: 0.18em;
  color: rgba(155, 95, 255, 0.28);
  text-transform: uppercase;
  pointer-events: none;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.4rem 0 1rem;
}

/* ── Per-folder colour identity ── */
.mobile-menu-link {
  --mc: 155, 95, 255; /* default: purple */
}
.mobile-menu-link--home    { --mc: 155,  95, 255; }
.mobile-menu-link--shop    { --mc: 110, 220,  80; }
.mobile-menu-link--gloom   { --mc: 220,  55,  65; }
.mobile-menu-link--blog    { --mc: 190,  90, 255; }
.mobile-menu-link--contact { --mc:  60, 200, 220; }
.mobile-menu-link--cart    { --mc: 245, 200,  50; }
.mobile-menu-link--admin   { --mc: 255, 140,  50; }
.mobile-menu-link--account { --mc: 180, 130, 255; }
.mobile-menu-link--login   { --mc: 180, 130, 255; }

/* ── Staggered folder entrance ─────────────────────────── */
@keyframes folder-in {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0); }
}

.mobile-menu-link,
.mobile-menu-divider {
  animation: folder-in 200ms ease-out both;
}

/* Each folder slides in 45ms after the previous one */
.mobile-menu-nav > :nth-child(1) { animation-delay:  60ms; }
.mobile-menu-nav > :nth-child(2) { animation-delay: 105ms; }
.mobile-menu-nav > :nth-child(3) { animation-delay: 150ms; }
.mobile-menu-nav > :nth-child(4) { animation-delay: 195ms; }
.mobile-menu-nav > :nth-child(5) { animation-delay: 240ms; }
.mobile-menu-nav > :nth-child(6) { animation-delay: 275ms; }
.mobile-menu-nav > :nth-child(7) { animation-delay: 310ms; }
.mobile-menu-nav > :nth-child(8) { animation-delay: 345ms; }
.mobile-menu-nav > :nth-child(9) { animation-delay: 380ms; }

/* Don't re-animate individual folders on close — the drawer slides as a unit */
.mobile-menu--closing .mobile-menu-link,
.mobile-menu--closing .mobile-menu-divider {
  animation: none;
}

/* Each link = a coloured folder standing in the drawer */
.mobile-menu-link {
  display: flex;
  align-items: center;
  /* Extra left padding for the colour stripe */
  padding: 0 1.2rem 0 1.6rem;
  height: 3.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(var(--mc), 0.70);
  /* Folder edge lines — faint bottom border separating each folder */
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.025);
  position: relative;
  transition: color 120ms ease, background 120ms ease, padding-left 140ms ease;
}

/* Left colour stripe — the folder's colour tab stuck to the spine */
.mobile-menu-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg,
    rgba(var(--mc), 0.70) 0%,
    rgba(var(--mc), 0.42) 100%
  );
  box-shadow: 2px 0 10px rgba(var(--mc), 0.20);
  transition: background 120ms ease, box-shadow 120ms ease;
}

/* Right pull arrow — the file tab you grab to pull out the folder */
.mobile-menu-link::after {
  content: "›";
  position: absolute;
  right: 1.1rem;
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(var(--mc), 0.25);
  transition: color 120ms ease, right 140ms ease;
}

/* Hover: folder pulls out of the drawer toward you */
.mobile-menu-link:hover {
  color: rgba(var(--mc), 0.95);
  background: rgba(var(--mc), 0.055);
  padding-left: 2rem;
}

.mobile-menu-link:hover::before {
  background: linear-gradient(180deg,
    rgba(var(--mc), 0.90) 0%,
    rgba(var(--mc), 0.60) 100%
  );
  box-shadow: 2px 0 14px rgba(var(--mc), 0.38);
}

.mobile-menu-link:hover::after {
  color: rgba(var(--mc), 0.65);
  right: 0.8rem;
}

/* Active: this folder is open */
.mobile-menu-link.is-active {
  color: rgba(var(--mc), 1);
  text-shadow: 0 0 12px rgba(var(--mc), 0.5);
  background: rgba(var(--mc), 0.08);
}

.mobile-menu-link.is-active::before {
  background: linear-gradient(180deg,
    rgba(var(--mc), 1)    0%,
    rgba(var(--mc), 0.72) 100%
  );
  box-shadow:
    2px 0 12px rgba(var(--mc), 0.55),
    3px 0 24px rgba(var(--mc), 0.25);
}

.mobile-menu-link.is-active::after {
  color: rgba(var(--mc), 0.55);
}

/* Metal drawer divider tab */
.mobile-menu-divider {
  height: 2px;
  margin: 0.3rem 0;
  background: linear-gradient(90deg,
    rgba(155, 95, 255, 0.22) 0%,
    rgba(155, 95, 255, 0.08) 60%,
    transparent              100%
  );
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* ── Comprehensive mobile overrides ───────────────────── */

@media (max-width: 640px) {
  /* Base font size boost — all rem values scale with this */
  html { font-size: 20px; }

  /* Nav: hide desktop tabs, show hamburger + brand */
  .nav-bar {
    height: 2.6rem;
    padding: 5px 6px 0;
  }

  .cabinet-menu,
  .cabinet-menu-right {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-mobile-brand {
    display: flex;
  }

  /* Viewport: match nav height */
  .page-viewport {
    padding-top: 2.8rem;
  }

  /* Page panel: tighter horizontal padding */
  .page-panel {
    padding: 1.5rem 1rem;
  }

  /* ── Home page ── */
  .home-panel {
    gap: 1rem;
  }

  .home-sticker {
    width: clamp(72px, 18vw, 110px);
  }

  .home-sticker-link {
    top: 0.8rem;
    right: 0.8rem;
  }

  .panel-copy {
    font-size: clamp(0.72rem, 3.5vw, 0.88rem);
    color: rgba(228, 208, 255, 0.95);
  }

  .home-desc {
    font-size: 0.7rem;
    color: rgba(210, 178, 255, 0.93);
    max-width: 32ch;
  }

  .boot-log {
    font-size: clamp(0.6rem, 3.5vw, 0.75rem);
    color: rgba(210, 178, 255, 0.9);
  }

  .boot-panel {
    padding: 1.6rem 1.2rem;
  }

  /* ── Shop ── */
  .shop-panel {
    padding-top: 1.5rem;
    gap: 1rem;
  }

  .shop-meta {
    font-size: 0.6rem;
    color: rgba(210, 178, 255, 0.87);
  }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding-bottom: 2rem;
  }

  /* ── Product cards ── */
  .product-name {
    font-size: 0.68rem;
    color: #dbbeff;
  }

  .product-sub {
    font-size: 0.5rem;
    color: rgba(196, 160, 255, 0.7);
  }

  .product-id {
    font-size: 0.44rem;
    color: rgba(155, 95, 255, 0.7);
  }

  .product-price {
    font-size: 0.72rem;
  }

  .product-status {
    font-size: 0.46rem;
    color: rgba(210, 178, 255, 0.87);
  }

  .product-info {
    padding: 0.6rem 0.6rem 0.65rem;
    gap: 0.25rem;
  }

  .filter-chip {
    font-size: 0.46rem;
    padding: 0.22rem 0.6rem;
  }

  /* ── Product detail page ── */
  .product-page-desc {
    font-size: 0.62rem;
    color: rgba(218, 190, 255, 0.88);
  }

  .product-page-acquire {
    font-size: 0.62rem;
    padding: 0.7rem 0.5rem;
  }

  .product-page-note {
    font-size: 0.5rem;
    color: rgba(210, 178, 255, 0.72);
  }

  .product-tab {
    font-size: 0.5rem;
    letter-spacing: 0.12em;
    padding: 0.55rem 0.4rem;
  }

  .admin-btn {
    font-size: 0.52rem;
  }

  /* ── Channel / AI chat ── */
  .channel-message {
    font-size: 0.6rem;
    line-height: 1.85;
  }

  .channel-message--creature {
    color: rgba(218, 190, 255, 0.9);
  }

  .channel-message--user {
    color: rgba(196, 160, 255, 0.87);
  }

  .channel-input {
    font-size: 0.62rem;
  }

  .channel-send-btn {
    font-size: 0.48rem;
    padding: 0.35rem 0.65rem;
  }

  .channel-auth-sub {
    font-size: 0.6rem;
    color: rgba(210, 178, 255, 0.87);
  }

  .channel-auth-label {
    font-size: 0.5rem;
    color: rgba(196, 160, 255, 0.93);
  }

  .channel-status-label {
    font-size: 0.48rem;
    color: rgba(196, 160, 255, 0.83);
  }

  .channel-counter {
    font-size: 0.44rem;
    color: rgba(196, 160, 255, 0.77);
  }

  .channel-connecting {
    font-size: 0.54rem;
    color: rgba(196, 160, 255, 0.9);
  }

  /* ── Blog ── */
  .blog-panel {
    padding-top: 1.5rem;
    gap: 1rem;
  }

  .blog-card-title {
    font-size: clamp(0.78rem, 4vw, 0.96rem);
    color: #dbbeff;
  }

  .blog-card-excerpt {
    font-size: 0.6rem;
    color: rgba(210, 178, 255, 0.85);
  }

  .blog-card-date {
    font-size: 0.5rem;
    color: rgba(196, 160, 255, 0.8);
  }

  .blog-card-read {
    font-size: 0.52rem;
    color: rgba(155, 95, 255, 0.75);
  }

  /* ── Blog post ── */
  .blog-post-body p {
    font-size: clamp(0.62rem, 3.5vw, 0.76rem);
    color: rgba(218, 192, 255, 0.88);
  }

  /* ── Lore / Gloomopedia ── */
  .lore-panel {
    padding-top: 0.4rem;
  }

  .lore-layout {
    grid-template-columns: 1fr;
    /* Single row — whichever panel is visible fills the full height */
    grid-template-rows: 1fr;
    flex: 1;
  }

  .lore-index {
    border-right: none;
    border-bottom: 1px solid rgba(155, 95, 255, 0.08);
  }

  .lore-index--hidden {
    display: none;
  }

  .lore-detail {
    display: none;
  }

  .lore-detail--visible {
    display: flex;
  }

  /* ── Contact ── */
  .contact-panel {
    gap: 1.8rem;
    padding: 1.2rem 1rem;
  }

  .contact-field-label {
    min-width: 5rem;
    font-size: 0.44rem;
    color: rgba(196, 160, 255, 0.8);
  }

  .contact-field-value {
    font-size: 0.55rem;
    color: rgba(210, 178, 255, 0.82);
  }

  .contact-note {
    font-size: 0.5rem;
    color: rgba(155, 95, 255, 0.68);
  }

  /* ── Account ── */
  .account-section-label {
    font-size: 0.48rem;
    color: rgba(196, 160, 255, 0.93);
  }

  /* ── Cart ── */
  .cart-item-name {
    font-size: 0.56rem;
  }

  .cart-item-price {
    font-size: 0.62rem;
  }

  .cart-total-amount {
    font-size: 0.72rem;
  }

  /* ── Claims ── */
  .claim-terminal {
    padding: 1.2rem 1.1rem 1.4rem;
  }

  .claim-line {
    font-size: 0.68rem;
  }

  .claim-step {
    font-size: 0.56rem;
  }

  /* ── Panel title sizing ── */
  .panel-title {
    font-size: clamp(1.6rem, 11vw, 2.4rem);
  }

  .admin-title {
    font-size: clamp(0.9rem, 5vw, 1.3rem);
  }

  /* ── Prevent iOS auto-zoom on input focus (requires font-size ≥ 16px) ── */
  input, textarea, select {
    font-size: 16px !important;
  }

  /* ── Boot sequence: shrink font to fit longest line on one row ── */
  .boot-log {
    font-size: 0.56rem;
  }

  .boot-panel {
    overflow: hidden;
  }

  /* ── Page transitions: simple fade instead of CRT static ── */
  .crt-screen.is-switching {
    animation: mobile-channel-jump 400ms linear both;
  }

  .channel-static.is-switching {
    animation: none;
    opacity: 0;
  }
}

@keyframes mobile-channel-jump {
  /* Overload flash */
  0%   { filter: brightness(1);    }
  8%   { filter: brightness(6);    }
  /* Snap black — content invisible while new page loads */
  20%  { filter: brightness(0.01); }
  /* Hold — content renders at 75% (300ms) */
  73%  { filter: brightness(0.01); }
  /* New channel: dot flash then settle */
  82%  { filter: brightness(4);    }
  100% { filter: brightness(1);    }
}
