:root {
  /* ---------------- root ---------------- */
  --black: #2d2d2d; /* background */
  --white: #f7f4ee; /* text */
  --grey: #9b9ba0; /* for ui elements */
  --color-1: #ffffff;
  --color-2: #ffffff;
  --color-3: #ffffff;
  --color-4: #000000;
  --font-size-panel: 0.64rem; /* font size headline */
  --font-size-h1: 2.5rem; /* font size subline */
  --font-size-h2: 1.2rem; /* font size buttons */
  --font-size-text: 0.85rem; /* font size buttons */
  --font-size-1-rem: 1rem;
  /* theme surfaces */
  --bg: #1c1c1c;
  --bg-panel: #111111;
  --bg-panel-border: rgba(211, 211, 255, 0.12);
  --text: #f7f4ee;
  --text-dim: #9b9ba0;
  --border-subtle: rgba(255, 255, 255, 0.08);
}

html {
  /*   text-shadow: 0 0 8px rgba(76, 201, 240, 0.4); */
  height: 100%;
  cursor: auto;
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

body {
  height: 100%;
  margin: 0;
  color: #d4d4d8;
  overflow: auto;
  user-select: none;
}

main {
  height: 100%;
}

img {
  user-select: none;
}

a {
  font-weight: 400;
  border: none;
}

a:link,
a:visited,
a:hover,
a:active {
  text-decoration: underline;
}

.a-1 {
  color: rgb(66, 66, 255);
}

.a-2 {
  color: rgb(66, 66, 255);
}

.a-3 {
  color: rgb(66, 66, 255);
}

/* NeueBit */
@font-face {
  font-family: "NeueBit";
  src: url("../assets/fonts/neuebit/PPNeueBit-Bold.otf") format("opentype");
  font-style: normal;
}

/* ArialNarrow woff */
@font-face {
  font-family: "ArialNarrow";
  src: url("../assets/fonts/arial_narrow/arial_narrow.woff2") format("woff2");
  font-style: normal;
}

/* is-hidden */
.is-hidden {
  display: none !important;
}

/* body */
body {
  margin: 0;
  min-height: 100vh;
  background: #9b9ba0;
}

/* iframe */
iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* mechanical-ragger */
mechanical-ragger {
  --ragging-width: 7rem;
}
/* Media Queries */
@media (min-width: 480px) {
  mechanical-ragger {
    --ragging-width: 2rem;
  }
}

.italic {
  font-family: "ArialNarrow";
  font-style: italic;
}

.centered {
  text-align: center;
}

.monospaced {
  font-family: "ArialNarrow";
  font-size: 1rem;
  line-height: 1.2rem;
}

.monospaced-white {
  font-family: "ArialNarrow";
  font-size: 1rem;
  line-height: 1.2rem;
  color: white;
  padding: 0px 0px 10px 0px;
}

.monospaced-link {
  font-family: "ArialNarrow";
  font-size: 1rem;
  line-height: 1.2rem;
}

.highlight-light {
  background: var(--color-3);
  color: black;
}

.highlight-mid {
  background: var(--color-1);
  color: black;
}

.highlight-dark {
  background: var(--color-1);
  color: black;
}

.font-pixel {
  margin: 0px;
  font-family: "ArialNarrow", monospace;
  font-style: "regular";
  font-size: 4.8rem;
}

/* tool frame */
.toolFrame {
  position: fixed;
  top: 28px;
  bottom: 0px;
  left: 0;
  right: 0;
  z-index: 1;
}
/* for self hosted tools */
.sketch-container {
  position: fixed;
  top: 0px;
  right: 250px;
  bottom: 0px;
  z-index: 1;
}

/* #views — fixed container offset from the sidebar */
#views {
  position: fixed;
  left: 240px;
  top: 28px;
  right: 0;
  bottom: 0;
  overflow: hidden;
  transition: left 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Push the view area right when a side panel is visible next to the main panel */
#views:has(.view-shuffle.active) {
  left: 460px; /* 240px main panel + 220px history panel */
}

#views:has(.view-stories.active) {
  left: 450px; /* 240px main panel + 210px story selector */
}

/* views */
/* toggle view */
.view {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.view::-webkit-scrollbar {
  display: none;
}

.view.active {
  display: block;
  z-index: 2;
}

/* views that manage their own scroll / use transform pan */
.view-map,
.view-shuffle,
.view-stories {
  overflow: hidden;
}

.view-stories.active {
  background: #9b9ba0;
  display: flex;
  flex-direction: column;
}
.view.leaving {
  opacity: 0;
  transform: scale(1.01);
}
@keyframes viewFlash {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.4);
  }
  100% {
    filter: brightness(1);
  }
}

/* list view */
.view-list.active {
  background: #9b9ba0;
}

.tool-list {
  font-family: "ArialNarrow";
  font-style: regular;
  padding: 0 0 80px 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  color: white;
}
.tool-row {
  position: relative;
  font-size: 1rem;
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr 1.1fr 0.9fr 1fr;
  padding: 8px 20px;
  border-bottom: 1px solid rgb(137, 137, 137);
  box-shadow: inset 3px 0 0 transparent;
  transition:
    background 300ms ease,
    box-shadow 0.08s ease;
}
.tool-row:hover {
  background: grey;
}
.tool-row.header {
  mix-blend-mode: multiply;
  padding: 0px 20px;
  font-size: 1rem;
  position: sticky;
  top: 0;
  background: black;
  color: darkgrey;
  z-index: 9;
}
.tool-row > div {
  display: flex;
  align-items: center;
}
.grid-item {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  transition:
    background 0.15s ease,
    outline-color 0.15s ease;
}
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grid-item {
  justify-items: center;
  align-items: center;
}
.grid-item p {
  display: none;
}

.view-shuffle {
  overflow: hidden;
}

.view-shuffle.active {
  background: #9b9ba0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* deck + controls centred in the view */
.sd-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* shuffle + reset buttons side by side */
.sd-controls {
  display: flex;
  gap: 12px;
}

/* Shuffle button */
.sd-btn {
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: white;
  background: transparent;
  border: 1px solid white;
  padding: 0px 15px 2px 15px;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

#sd-toggle-btn {
  font-family: "ArialNarrow";
  font-size: 1.3rem;
}

#sd-reset-btn {
  font-family: "ArialNarrow";
  font-size: 1.3rem;
}

.sd-history {
  position: fixed;
  left: 240px;
  top: 28px;
  bottom: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  z-index: 50;
}

.sd-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  top: 0;
  background: rgba(43, 43, 43, 0.8);

  padding: 0px 20px 0px 10px;
  border: none;
  flex-shrink: 0;
}

.sd-history-title {
  font-family: "ArialNarrow", sans-serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  padding: 2px 0px 2px 0px;
}

.sd-history-count {
  font-family: "ArialNarrow", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: grey;
  letter-spacing: 0.05em;
}

.sd-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sd-history-list::-webkit-scrollbar {
  display: none;
}

.sd-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sd-history-thumb {
  width: 52px;
  height: 74px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #2d2d2d;
}

.sd-history-thumb img {
  width: 100%;
  height: 100%;
  background: rgba(43, 43, 43, 0.9);
  object-fit: cover;
  display: block;
}

.sd-history-item-name {
  font-family: "ArialNarrow";
  font-size: 0.85rem;
  color: rgba(43, 43, 43, 0.9);
  flex: 1;
  text-transform: lowercase;
  line-height: 1.5;
  letter-spacing: 0.03em;
  word-break: break-word;
}

.sd-history-dl {
  font-family: "IBMPlexMono", monospace;
  background: none;
  border: 1px solid rgba(43, 43, 43, 0.9);
  color: rgba(43, 43, 43, 0.9);
  font-size: 0.85rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition:
    border-color 0.1s ease,
    color 0.1s ease;
}

.sd-history-dl:hover {
  border-color: var(--color-1);
  color: var(--color-1);
}

/* Stacked card deck — portrait trading-card ratio */
.sd-deck {
  position: relative;
  width: 340px;
  height: 500px;
}

/* ── Card ── */
.sd-card {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: row;
  background: #ffffff;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}

/* ratings */
.sd-card-ratings {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;

  display: flex;
  flex-direction: column;
  gap: 4px;

  z-index: 5;
}

.sd-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-family: "ArialNarrow";
  font-size: 0.78rem;
  text-transform: lowercase;
  line-height: 1;
  letter-spacing: 0.03em;
}

.sd-rating-label {
  color: rgba(0,0,0,0.7);
}

.sd-rating-blocks {
  display: flex;
  gap: 1px;
}

.sd-rating-block {
  color: rgba(0,0,0,0.16);
  font-size: 0.9rem;
  line-height: 1;
}

/* noise overlay */
.sd-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

/* main content area */
.sd-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 10px 14px 14px;
  position: relative;
  min-width: 0;
  z-index: 1;
}

/* top section: preview centred, QR absolute top-right of content */
.sd-card-top {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

/* square preview image, centred */
.sd-card-preview-wrap {
  width: 150px;
  height: 150px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f0f0f0;
}

.sd-card-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* QR code — top-right corner of content area */
.sd-card-qr {
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 52px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
}

.sd-card-qr img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

/* tool name — bigger, same font */
.sd-card-name {
  font-family: "ArialNarrow", monospace;
  font-size: 1.8rem;
  color: #000;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* filter colour stripes — right edge, like folder-tab dividers */
.sd-card-stripes {
  width: 10px;
  height: 200px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.07);
  z-index: 1;
}

.sd-card-stripe {
  flex: 1;
}

/* paused — top card is clickable and slides to the right */
.sd-deck.paused .sd-card:last-child {
  pointer-events: auto;
  transform: translateX(88px) rotate(-4deg) !important;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.22s ease !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 6px 20px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1.5px rgba(0, 0, 0, 0.1);
}

.sd-deck.paused .sd-card:last-child:hover {
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 0 0 2px var(--color-1);
}

/* "click to enter" call-to-action above the featured card */
.sd-cta {
  font-family: "IBMPlexMono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  transform: translateX(44px); /* offset to sit above the shifted card */
  white-space: nowrap;
}

.sd-cta.visible {
  opacity: 1;
}

.sd-btn:hover {
  border-color: var(--color-1);
  color: var(--color-1);
}

.sd-btn.active {
  border-color: var(--color-1);
  color: var(--color-1);
}

/* read view */
.read-view {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.magazine {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0c0c0e;
}
.magazine-track {
  display: flex;
  perspective: 2000px;
  transform-style: preserve-3d;
}
.spread {
  display: none;
  width: 80vw;
  height: 80vh;
  background: #0f0f12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.7);
}
.spread.active {
  display: flex;
}
.page {
  flex: 1;
  padding: 60px;
  position: relative;
  background: #0d0f13;
  color: white;
  overflow: hidden;
}
.page.right {
  transform-origin: left;
  z-index: 5;
  border-right: none;
}
.page.flipping {
  animation: flipPage 0.7s ease forwards;
}
@keyframes flipPage {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(-90deg);
  }
  100% {
    transform: rotateY(-180deg);
  }
}
.page.flip-out-right {
  animation: flipRight 0.8s ease forwards;
}
@keyframes flipRight {
  0% {
    transform: rotateY(0deg);
    transform-origin: left;
  }
  100% {
    transform: rotateY(-180deg);
    transform-origin: left;
  }
}
.page.flip-out-left {
  animation: flipLeft 0.8s ease forwards;
}
@keyframes flipLeft {
  0% {
    transform: rotateY(0deg);
    transform-origin: right;
  }
  100% {
    transform: rotateY(180deg);
    transform-origin: right;
  }
}
.page.right::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.page.flipping::after {
  opacity: 1;
}
.read-img {
  max-height: 60%;
  overflow: hidden;
}
.read-img img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* oder contain je nach Stil */
}
.read-text {
  max-width: 55ch;
  margin: 0 auto;
}

/* tooltip */
#tool-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
  width: 120px;
  height: 120px;
  background: black;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: none;
  padding: 4px;
}
#tool-tooltip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* preview */
.preview {
  display: none;
}

/* manifesto */
/* floating panel base */
#manifesto-panel.hidden {
  opacity: 0;
  transform: scale(0.98) translateY(-10px);
  pointer-events: none;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

#manifesto-panel {
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
}

#manifesto-panel .panel-content {
  overflow-y: auto;
  padding: 12px;
  user-select: text;
}

#manifesto-panel .panel-content::-webkit-scrollbar {
  width: 6px;
}

#manifesto-panel .panel-content::-webkit-scrollbar-track {
  background: transparent;
}

#manifesto-panel .panel-content::-webkit-scrollbar-thumb {
  background: rgba(211, 211, 255, 0.3);
  border-radius: 10px;
}

#manifesto-panel .panel-content p {
  margin-bottom: 1rem;
  line-height: 1.5;
  max-width: 42ch;
}

#imprint-panel .panel-content {
  overflow-y: auto;
  padding: 12px;
  user-select: text !important;
}

#imprint-panel .panel-content::-webkit-scrollbar {
  width: 6px;
}

#imprint-panel .panel-content::-webkit-scrollbar-track {
  background: transparent;
}

#imprint-panel .panel-content::-webkit-scrollbar-thumb {
  background: rgba(211, 211, 255, 0.3);
  border-radius: 10px;
}

#imprint-panel.hidden {
  opacity: 0;
  transform: scale(0.98) translateY(-10px);
  pointer-events: none;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

#submit-panel .panel-content {
  overflow-y: auto;
  padding: 12px;
  user-select: text !important;
}

#submit-panel .panel-content::-webkit-scrollbar {
  width: 6px;
}

#submit-panel .panel-content::-webkit-scrollbar-track {
  background: transparent;
}

#submit-panel .panel-content::-webkit-scrollbar-thumb {
  background: rgba(211, 211, 255, 0.3);
  border-radius: 10px;
}

#submit-panel.hidden {
  opacity: 0;
  transform: scale(0.98) translateY(-10px);
  pointer-events: none;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.floating-panel {
  position: fixed;
  top: 68px; /* just below the status bar + a small gap */
  left: 240px; /* flush with the right edge of the main panel */
  width: 320px;
  max-height: calc(100vh - 96px);
  overflow: hidden;
  display: flex;
  flex-direction: column;

  background: rgba(10, 10, 12, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(20px);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6);

  z-index: 1100;
  transform-origin: left center;

  /* InDesign-style: slide out from behind the main panel */
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition:
    transform 200ms cubic-bezier(0, 0, 0.2, 1),
    opacity 160ms ease;
}

/* hidden = tucked back behind the main panel */
.floating-panel.hidden {
  transform: translateX(calc(-100% - 4px));
  opacity: 0;
  pointer-events: none;
}

/* header */
.floating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  user-select: none;
}

/* close button */
.close-btn {
  background: none;
  color: white;
  border: none;
}
/* content */
.floating-content {
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: white;
  user-select: text;
}

/* display / theme panel */
#display-panel {
  margin-top: auto;
}
.display-panel-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 6px;
}

/* main-panel */
#main-panel {
  position: fixed;
  top: 28px;
  left: 0;
  width: 240px;
  height: calc(100vh - 28px);
  background: rgba(43, 43, 43, 0.9);
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  font-family: "ArialNarrow", sans-serif;
  color: var(--white);
  z-index: 999;
  padding: 8px 0 1px 0;
  transition: height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-panel > div {
  border-radius: 5px;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
/* panel header */
.panel-header {
  position: relative;
  display: flex;
  align-items: bottom;
  justify-content: left;
  user-select: none;
  font-size: 0.8rem;
  color: grey;
  padding: 12px 2px 8px 2px;
  margin: 5px 0px 5px 0px;
}
#first-panel .panel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* comments panel */
.theme-column {
  display: flex;
  flex-wrap: wrap;
}
.filter-column {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0px 0px 40px 5px;
}

.panel-header {
  position: relative;
  transition: background 0.15s ease;
}

.segmented-control {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0;
  padding: 2px 0px 8px 0px;
  background: transparent;
  border: none;
  overflow: hidden;
}

/* hide the sliding bg indicator — not needed with direct button colouring */
.segmented-bg {
  display: none;
}

/* buttons */
.seg-btn {
  appearance: none;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 10px 5px 10px 5px;
  margin: 5px;
  border-radius: 33px;
  background: transparent;
  color: grey;
  font-family: "ArialNarrow";
  font-size: 1.4rem;
  line-height: 1;
  border: 1px solid transparent;
  transition:
    color 200ms ease,
    border 100ms ease;
}

#list-btn {
  padding: 10px 0px 10px 0px;
}

#map-btn {
  padding: 10px 3px 10px 3px;
}

#cards-btn {
  padding: 10px 8px 10px 8px;
}

/* hover */
.seg-btn:hover {
  color: grey;
}
/* active — plain white background, black text */
.seg-btn.active {
  background: black;
  color: grey;
}


#outputs-panel {
  margin-bottom: 5px;
}

/* stories / gallery / manifesto / submit — unified nav buttons */
.stories-btn,
.gallery-btn,
.manifesto-btn,
.submit-btn,
.imprint-btn {
  font-family: "ArialNarrow", sans-serif;
  font-size: 1.5rem;
  text-transform: lowercase;
  letter-spacing: 0;
  display: block;
  width: 100%;
  padding: 0px 5px 5px 20px;
  border-radius: 0;
  border: none;
  background: transparent;
  text-decoration: underline;
  text-align: left;
  cursor: pointer;
  line-height: 1.7;
  position: relative;
}

.stories-btn {
  color: rgb(66, 66, 255);
}

.gallery-btn {
  color: rgb(66, 66, 255);
}

.manifesto-btn {
  color: rgb(66, 66, 255);
}

.submit-btn {
  color: rgb(66, 66, 255);
}

.imprint-btn {
  color: rgb(66, 66, 255);
}

.stories-btn:hover,
.gallery-btn:hover,
.manifesto-btn:hover,
.submit-btn:hover,
.imprint-btn:hover {
  color: white;
}

/* filters */
.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0px 4px 2px 7px;
  border: none;
  border-radius: 0px;
  font-size: 1.2rem;
  font-family: "ArialNarrow";
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition:
    opacity 200ms ease,
    transform 0.1s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  opacity: 0.75;
}

.filter-btn.active {
  transform: none;
}

.filter-icon {
  font-size: 1.2rem;
  padding: 0px 4px 0px 0px;
  line-height: 1;
  opacity: 0.75;
}

.filter-count {
  padding: 0px 0px 0px 3px;
  opacity: 0.5;
  font-size: 0.7rem;
}

/* Active filters strip — appears above the filter column */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 8px;
  margin-bottom: 15px;
  padding: 0px 0px 0px 5px;
}

.active-filters:empty {
  display: none;
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}
/* buttons editor view */
#backBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px 0px 0px 0px;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-family: "ArialNarrow", sans-serif;
  font-size: 0.98rem;
  transition: all 0.2s ease;
  position: relative;
  z-index: 9999;
}

#backBtn:hover {
  color: var(--white);
}

/* editor bar */
.editor-bar {
  position: fixed;
  top: 0;
  border: none;
  left: 0;
  right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: black;
  color: rgba(255, 255, 255, 0.42);
  z-index: 1001;
  pointer-events: auto;
}
.editor-bar-item-left,
.editor-bar-item-center,
.editor-bar-item-right {
  font-size: 1rem;
  display: flex;
}
.editor-bar-item-center {
  position: absolute;
  font-family: "ArialNarrow", sans-serif;
  font-size: 0.98rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.editor-bar-item-right {
  display: flex;
  align-items: center;
  gap: 3px;
}

.editor-filter-tag {
  display: inline-flex;
  align-items: center;
  font-size: 1.2rem;
  font-family: "ArialNarrow", sans-serif;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding: 0px 4px 2px 7px;
  border-radius: 0px;
  border: none;
  white-space: nowrap;
  background: transparent;
}

/* status bar top */
.status-bar-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  z-index: 1001;
}
.status-item-right-top {
  background: #111111;
  font-family: "NeueBit", monospace;
  font-style: "regular";
  letter-spacing: 0.05em;
  font-size: 1.5rem;
  color: white;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  display: flex;
}

#hover-info {
  font-family: "NeueBit", monospace;
  font-style: "regular";
  letter-spacing: 0.05em;
  font-size: 1.5rem;
  color: white;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
/* blinking cursor */
#hover-info::after {
  content: "_";
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

#hover-info.change {
  opacity: 0;
  transform: translateY(-3px);
}

.stories-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-card {
  border: 1px solid #ccc;
  padding: 16px;
}

.stories-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr; /* single row fills full available height */

  /* Must stretch to fill the flex parent (.view-stories.active) */
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;

  background: #9b9ba0;

  position: relative;
}

/* Hidden by default; shown only when .view-stories is active.
   Lives outside #views so position:fixed is relative to the true viewport. */
.story-selector {
  position: fixed;
  left: 240px;
  top: 28px;
  bottom: 0;
  width: 210px;
  z-index: 50;
  min-height: 0;
  display: none;
}

/* Show selector whenever the stories view is active */
body:has(.view-stories.active) .story-selector {
  display: grid;
}

/* LEFT SIDE — fills .stories-layout (grid) which fills .view-stories.active (flex) */
.story-content {
  position: relative;
  background: #9b9ba0;

  /* stretch to fill the grid cell */
  align-self: stretch;
  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 40px 24px;

  box-sizing: border-box;

  scrollbar-width: none;

  user-select: text;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* chrome/safari */
.story-content::-webkit-scrollbar {
  display: none;
}

/* story */
.story {
  display: none;
  width: min(760px, 100%);
  animation: fadeStory 0.4s ease;
}

.story.active {
  display: block;
}

.stories-text {
  padding: 20px 0px 10px 0px;
  font-size: 1.5rem;
  font-family: "ArialNarrow";
  line-height: 1.4;
  max-width: 58ch;
  color: white;
  margin-bottom: 1.2rem;
}

.stories-name {
  padding: 0px 0px 14px 0px;
  font-family: "ArialNarrow";
  color: white;
  font-size: 1rem;
}

.stories-made-with {
  font-family: "ArialNarrow";
  color: white;
  font-size: 1rem;
}

.story-selector {
  padding: 34px 0px 0px 0px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(43, 43, 43, 0.9);
  /* display is controlled by the :has() rule above — do not set it here */
  grid-template-columns: 1fr;
  column-gap: 0;
  row-gap: 0px;
  align-content: start;
  scrollbar-width: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.story-selector::-webkit-scrollbar {
  display: none;
}

.story img {
  width: 70%;
  height: auto;

  display: block;

  margin: 40px auto;

  object-fit: cover;
}

.story h1 {
  font-family: "ArialNarrow";
  font-weight: regular;
  font-size: 4rem;
  line-height: 6rem;
  color: white;
  padding: 0px;
  margin: 35px 0px 0px 0px;
}

.story-thumb-span {
  position: relative;
  display: flex;
  align-items: bottom;
  justify-content: left;
  user-select: none;
  font-family: "ArialNarrow";
  font-size: 0.8rem;
  color: grey;
  padding: 12px 2px 6px 6px;
}

.story-thumb-title {
  display: flex;
  align-items: center;
  font-family: "ArialNarrow";
  font-size: 1.2rem;
  line-height: 0.8rem;
  padding: 0px 4px 0px 7px;
  cursor: pointer;
}

.story-thumb {
  /*   box-shadow: 0px 2px 7px white; */
  display: flex;
  align-items: center;
  font-family: "ArialNarrow";
  font-size: 1.2rem;
  line-height: 0.8rem;
  background: grey;
  padding: 0px 4px 0px 7px;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.story-thumb:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
}

.story-thumb.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.story-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

.story-reveal.story-revealed {
  opacity: 1;
  transform: translateY(0);
}

.story-thumb img,
.story-thumb .selector-img,
.story-thumb .preview {
  display: none;
}

.view-map {
  overflow: hidden;
}

.view-map.active {
  background: #9b9ba0;
  display: flex;
  flex-direction: column;
}
/* canvas fills remaining space below the bar */
.map-canvas {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  user-select: none;
  position: relative;
}

.map-canvas.panning,
.map-canvas.panning * {
  cursor: grabbing !important;
}

.map-canvas.panning .map-square {
  animation-play-state: paused;
}

.map-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 3400px;
  height: 2400px;
  transform-origin: 0 0;
  will-change: transform;
}

/* hide unused placeholder elements */
.map-bg-preview,
.map-preview {
  display: none;
}

/* filter gravity centres */
.map-center {
  position: absolute;
  font-family: "ArialNarrow", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding: 0px 4px 2px 7px;
  border: none;
  border-radius: 0;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  z-index: 50;
  transition: opacity 0.3s ease;
}

/* tool cards */
@keyframes mapFloat {
  0%,
  100% {
    translate: 0px 0px;
  }
  18% {
    translate: 5px -6px;
  }
  42% {
    translate: 3px 5px;
  }
  65% {
    translate: -5px -3px;
  }
  85% {
    translate: -2px 6px;
  }
}

/* tool card */
.map-square {
  position: absolute;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border-subtle);
  background: #111318;
  padding: 0;
  transform: translate(-50%, -50%);
  rotate: var(--card-drag-rotate, 0deg);
  transition:
    border-color 0.14s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease,
    opacity 0.45s ease;
  z-index: 2;
  overflow: visible;
  opacity: 0;
  animation: mapFloat var(--float-dur, 5.5s) ease-in-out var(--float-delay, 0s)
    infinite;
}

/* card becomes visible after stagger (class added by JS) */
.map-square.visible {
  opacity: 1;
}

/* dim every card except the one being hovered */
.map-world:has(.map-square:hover) .map-square:not(:hover) {
  opacity: 0.18;
}

.map-square:hover {
  border-color: var(--color-1);
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow: 0 0 18px rgba(255, 46, 77, 0.14);
  z-index: 20;
}

/* ── Preview image fills the card; pixelation via inline styles ─────────── */
.map-square .map-preview-img {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.map-square .map-preview-img a {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 88px; /* overridden per-frame by JS */
  height: 88px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: top left;
  image-rendering: pixelated; /* always nearest-neighbour — JS sets auto at level 0 */
  border: none;
}

/* ── Tool name – shown to the right of card on hover ──────────────────── */
.map-square .map-name {
  position: absolute;
  left: calc(100% + 9px);
  top: 25%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-family: "ArialNarrow";
  color: white;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  background: black;
  padding: 2px 6px;
}

.map-square:hover .map-name {
  opacity: 1;
}

/* ── Filter tags – hidden (name is the only label shown on hover) ───────── */
.map-square .map-filter {
  display: none;
}

.map-filter-tag {
  font-size: 0.38rem;
  font-family: "IBMPlexMono", monospace;
  padding: 0px 5px;
  border-radius: 0;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  /* background + color set per-tag by JS */
}

/* hide unused elements */
.map-square .anchor {
  display: none;
}

/* axis SVG layer */
.map-axis-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.map-hint {
  position: absolute;
  top: 36px;
  left: 70%;
  transform: translateX(-50%);
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-family: "ArialNarrow";
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  padding: 0px 14px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
}

.map-hint.visible {
  animation: mapHintFade 3.4s ease forwards;
}

@keyframes mapHintFade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  10% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }
}

/* vertical line (tracks X) — spans full canvas height */
.map-cursor-line-x {
  top: 0;
  bottom: 0;
  width: 1px;
  /* solid accent in ruler band, faint below */
  background: linear-gradient(
    to bottom,
    var(--color-1) 0px,
    var(--color-1) 20px,
    rgba(255, 46, 77, 0.1) 20px,
    rgba(255, 46, 77, 0.1) 100%
  );
  transform: translateX(-0.5px);
}

/* small circle at bottom end of vertical line */
.map-cursor-line-x::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--color-1);
  border: 1px solid white;
  border-radius: 50%;
  transform: translate(-50%, 50%);
}

/* horizontal line (tracks Y) — spans full canvas width */
.map-cursor-line-y {
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    var(--color-1) 0px,
    var(--color-1) 20px,
    rgba(255, 46, 77, 0.1) 20px,
    rgba(255, 46, 77, 0.1) 100%
  );
  transform: translateY(-0.5px);
}

/* small circle at right end of horizontal line */
.map-cursor-line-y::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--color-1);
  border: 1px solid white;
  border-radius: 50%;
  transform: translate(50%, -50%);
}

/* ── Map HUD preview (top-right) ─────────────────────────────────────────── */
.map-hud {
  position: absolute;
  top: 34px;
  right: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  width: 220px;
  pointer-events: none;
  font-family: "ArialNarrow";
  font-size: 1rem;
  letter-spacing: 0.06em;
  padding: 0px 5px 0px 5px;
}

.map-hud-time {
  background: rgba(10, 12, 16, 0.55);
  padding: 0px 5px 0px 5px;
  color: rgba(255, 255, 255, 0.55);
}

.map-hud-name {
  background: rgba(10, 12, 16, 0.55);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 180px;
  text-align: right;
  white-space: nowrap;
  padding: 0px 5px 0px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.map-hud-coords {
  padding: 0px 5px 0px 5px;
  background: rgba(10, 12, 16, 0.55);
  display: flex;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
}

.map-hud-label {
  color: rgba(255, 255, 255, 0.55);
  background: none;
  margin-right: 0px;
}

.map-hud-filters {
  background: rgba(10, 12, 16, 0.55);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 180px;
  text-align: right;
  padding: 0px 5px 0px 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.view-gallery {
  padding-left: 260px;
  box-sizing: border-box;
}

.view-gallery.active {
  display: flex;
  flex-direction: column;
}

.gallery-upload-btn {
  position: fixed;
  top: 44px;
  right: 24px;
  z-index: 50;
  background: black;
  font-family: "ArialNarrow";
  font-size: 1.2rem;
  color: white;
  padding: 10px 14px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  border: none;
  cursor: pointer;

  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.gallery-upload-btn:hover {
  background: grey;
}

.gallery-grid {
  columns: 4;
  column-gap: 20px;
  margin-top: 100px;
  padding-right: 24px;
}

.gallery-grid-item {
  width: 100%;
  break-inside: avoid;
}

/* ── Right-panel slide animations ────────────────────────────────────────── */

/* Enter: slides in from the left (from behind the main panel) */
@keyframes panelSlideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Exit: slides back out to the left (behind the main panel) */
@keyframes panelSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Trigger enter animation when shuffle view becomes active */
.view-shuffle.active .sd-history {
  animation: panelSlideIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Trigger enter animation when stories view becomes active.
   Selector now lives outside #views so :has() is used on body. */
body:has(.view-stories.active) .story-selector:not(.panel-exit) {
  animation: panelSlideIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Exit animation — added by JS before the view switch */
.sd-history.panel-exit,
.story-selector.panel-exit {
  animation: panelSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Mobile overlay — desktop-only notice */
#mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  #mobile-overlay {
    display: flex;
  }
}

#mobile-msg {
  font-family: "NeueBit", monospace;
  font-size: 1.5rem;
  color: white;
  letter-spacing: 0.05em;
}

#mobile-msg::after {
  content: "_";
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
}
