:root {
  --bg: #060608;
  --fg: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.14);
  --pill: rgba(255, 255, 255, 0.10);
  --pillHover: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
}

body {
  background: #000;
  color: #e8e8e8;
  font: 14px/1.35 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.stage {
  min-height: 100%;
}

.split {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* LEFT SIDE */
.controls {
  width: 360px;
  min-width: 300px;
  max-width: 400px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.topbar.vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pill {
  border: 1px solid var(--line);
  background: var(--pill);
  color: var(--fg);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease;
  min-height: 42px;
}

.pill:hover {
  background: var(--pillHover);
}

.pill:active {
  opacity: 0.85;
}

.pill.ghost {
  opacity: 0.85;
  cursor: pointer;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  margin-top: 0;
}

.hidden {
  display: none;
}

.label {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--fg);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.input:focus {
  border-color: rgba(255, 255, 255, 0.26);
}

.msg {
  margin-top: 10px;
  color: var(--muted);
  min-height: 18px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.muted {
  color: #9a9a9a;
}

.note {
  margin-top: auto;
  color: #a8a8a8;
  font-size: 13px;
}

#colorInput {
  width: 56px;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

#hexInput {
  min-width: 120px;
}

.swatchRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
}

.swatch:hover,
.swatch:focus {
  border-color: rgba(255, 255, 255, 0.7);
}

#placedMarkActions {
  margin-top: 8px;
}

/* RIGHT SIDE */
.viewer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  padding: 18px;
}

.viewerShell {
  width: 100%;
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.viewerToolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.viewerToolbar .pill {
  min-width: 42px;
  min-height: 42px;
}

.irisViewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: #020202;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  padding: 12px;
}

.irisViewport.dragging {
  cursor: grabbing;
}

.irisWrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#iris {
  max-width: 92%;
  max-height: 92%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  pointer-events: none;
  display: block;
}

.pulseLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.pulseMarker {
  position: absolute;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.22);
  opacity: 0;
  transform: scale(0.6);
}

.pulseMarker.run {
  animation: oncePulse 0.95s ease-out 4;
}

@keyframes oncePulse {
  0% {
    opacity: 0.9;
    transform: scale(0.45);
  }
  45% {
    opacity: 0.75;
    transform: scale(1.8);
  }
  100% {
    opacity: 0;
    transform: scale(3.4);
  }
}

/* MOBILE */
@media (max-width: 900px) {
  .split {
    flex-direction: column;
  }

  .controls {
    width: 100%;
    max-width: none;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding: 14px 12px;
    gap: 10px;
  }

  .topbar.vertical {
    flex-direction: row;
    gap: 10px;
  }

  .topbar.vertical .pill {
    flex: 1;
  }

  .topbar.vertical > #btnHome {
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  .viewer {
    padding: 10px;
  }

  .viewerShell {
    height: 60vh;
    gap: 10px;
  }

  .viewerToolbar {
    justify-content: center;
  }

  .row {
    flex-wrap: wrap;
  }

  .row .pill,
  .row .input,
  .row input[type="color"] {
    width: 100%;
  }

  #colorInput {
    height: 44px;
  }

  .note {
    margin-top: 4px;
    font-size: 12px;
  }

  .irisViewport {
    background: #111;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.03);
  }

  #iris {
    max-width: 98%;
    max-height: 98%;
  }

  #walletBar .row {
    flex-direction: column;
    align-items: stretch;
  }

  #walletBar .row .pill {
    width: 100%;
  }

  #artistPanel .msg {
    line-height: 1.5;
  }
}

/* ABOUT / SERIES PAGES */
.aboutPage {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.aboutTop {
  margin-bottom: 20px;
}

.aboutContent h1 {
  font-size: 28px;
  margin-bottom: 6px;
}

.aboutContent h2 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 18px;
}

.aboutContent h3 {
  color: var(--muted);
  font-weight: normal;
  margin-bottom: 14px;
}

.aboutContent p {
  line-height: 1.5;
  margin: 10px 0;
}

.aboutContent ul {
  margin: 10px 0 10px 18px;
  color: var(--fg);
}

.aboutContent li {
  margin-bottom: 6px;
}

.aboutContent hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

/* BUTTON STATES */
.pill.selected {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

.pill.ghost {
  opacity: 0.55;
}

.swatchRow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.18);
  cursor: pointer;
  padding: 0;
  min-width: 0;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.swatch:hover,
.swatch:focus {
  border-color: rgba(255,255,255,0.7);
  transform: scale(1.04);
}

.swatch.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.22);
  transform: scale(1.05);
}

.footerLinksDesktop {
  display: flex;
}

.mobileFooterWrap {
  display: none;
}

/* MOBILE */
@media (max-width: 900px) {
  .footerLinksDesktop,
  .controls .note {
    display: none;
  }

  .mobileFooterWrap {
    display: block;
    padding: 0 12px 18px;
  }

  .footerLinksMobile {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }

  .footerLinksMobile .pill {
    flex: 1;
  }

  .mobileNote {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
  }
}

@media (max-width: 900px) {
  #placedMarkActions {
    flex-direction: column;
    align-items: stretch;
  }

  #placedMarkActions .pill {
    width: 100%;
  }
}

#placedMarkActions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

@media (max-width: 900px) {
  #placedMarkActions {
    flex-direction: column;
    align-items: stretch;
  }

  #placedMarkActions .pill {
    width: 100%;
  }
}

.sponsorQtyChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sponsorQtyChip {
  min-width: 64px;
}

@media (max-width: 900px) {
  .sponsorQtyChips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .sponsorQtyChip {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  #publicPoolPanel .row,
  #sponsorInvitePanel .row {
    flex-direction: column;
    align-items: stretch;
  }

  #publicPoolPanel .pill,
  #sponsorInvitePanel .pill {
    width: 100%;
  }
}

.irisLoading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.16);
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease, visibility 220ms ease;
  pointer-events: none;
  z-index: 3;
}

.irisLoading.hidden {
  opacity: 0;
  visibility: hidden;
}

.irisSpinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(
    from 0deg,
    rgba(91, 80, 207, 0.00) 80deg,
    rgba(91, 80, 207, 0.00) 130deg,
    rgba(91, 80, 207, 0.15) 190deg,
    rgba(91, 80, 207, 0.55) 230deg,
    rgba(91, 80, 207, 1.00) 290deg,
    rgba(91, 80, 207, 0.00) 340deg
  );
  animation: onceIrisSpinner 3.0s linear infinite;
}

.irisLoading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.14);
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease, visibility 220ms ease;
  pointer-events: none;
  z-index: 3;
}

.irisLoading.hidden {
  opacity: 0;
  visibility: hidden;
}

.irisLoadingCard {
  min-width: 180px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: rgba(12, 10, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.irisLoadingTitle {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  text-align: center;
}

.irisLoadingText {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.irisSpinner::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(12, 10, 16, 0.96);;

  /* offset cutout */
  top: 1px;
  left: 8px;
}

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

.fieldHint {
  margin-top: 6px;
  min-height: 0;
  font-size: 12px;
  line-height: 1.35;
}

.irisViewport {
  touch-action: none;
}