/* ═══════════════════════════════════════════════════════════════════
   PIX DROP — IN-LAB sub-page
   Layout: topbar (52px) → canvas wrap → HUD (auto height, 82–110px)
   Design rules: only flat tones — black #020202, grayscale, white,
   solid red #E92038. No gradients, no glows, no diagonals.
   Single-session canvas. Save to archive when full.
═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #E92038;
  --bg:       #020202;
  --canvas-bg:#060606;
  --top:      52px;
  /* HUD yüksekliği merkezi standarttan gelir (css/inlab-hud.css → --inlab-hud-h:85px).
     Tuval alanı bu değere göre rezerve edilir → şekiller HUD altına düşmez. */
  --hud:      var(--inlab-hud-h, 85px);
  --sf:       'Steelfish', sans-serif;
  --pp:       'Poppins', sans-serif;
  --g1:       #c9c9c9;
  --g2:       #7a7a7a;
  --g3:       #3a3a3a;
  --g4:       #1a1a1a;
  --g5:       #0e0e0e;
}

html, body {
  background: var(--bg);
  color: #fff;
  font-family: var(--pp);
  height: 100dvh; width: 100vw;
  overflow: hidden;
  user-select: none;
  cursor: crosshair;
}

/* ── CANVAS WRAP ─────────────────────────────────────────────────── */
#heapWrap {
  position: fixed;
  top: var(--top);
  left: 0;
  right: 0;
  bottom: var(--hud);
  background: var(--canvas-bg);
  overflow: hidden;
  z-index: 1;
  transition: background .25s ease;
}
body[data-tool="erase"] #heapWrap { cursor: cell; }

#heapWrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
#heapCanvas         { z-index: 1; }
#heapFallCanvas     { z-index: 2; }

/* ── INTRO (BRIEF BREAKER style) ─────────────────────────────────── */
.heap-intro {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.4rem;
  background: rgba(2,2,2,.94);
  pointer-events: auto;
  transition: opacity .5s ease, visibility .5s ease;
}
.heap-intro.is-fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hp-eyebrow {
  font-family: var(--pp);
  font-size: .48rem;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.hp-eyebrow::before,
.hp-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(233,32,56,.3);
  max-width: 55px;
}

.hp-title {
  font-family: var(--sf);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.03em;
  line-height: 1.02;
  color: #fff;
  margin-bottom: .6rem;
}
.hp-title em { font-style: normal; color: var(--red); }

.hp-sub {
  font-family: var(--pp);
  font-size: .56rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 2.2rem;
  max-width: 520px;
}

.hp-guide {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255,255,255,.13);
  width: 100%;
  max-width: 700px;
  margin-bottom: 1.5rem;
}
.hp-item {
  flex: 1;
  padding: 1.2rem .9rem;
  border-right: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.hp-item:last-child { border-right: none; }
.hp-item i {
  font-size: 1rem;
  color: var(--red);
  display: block;
  margin-bottom: .5rem;
}
.hp-item h5 {
  font-family: var(--sf);
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: .25rem;
  line-height: 1.1;
  letter-spacing: .02em;
}
.hp-item p {
  font-family: var(--pp);
  font-size: .45rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  letter-spacing: .04em;
}

/* ENTER BUTTON — solid red CTA */
.hp-enter {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  background: var(--red);
  color: #fff;
  border: 0;
  outline: 0;
  font-family: var(--pp);
  font-size: .52rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  padding: 1rem 1.8rem;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, padding .18s ease;
}
.hp-enter:hover {
  background: #ff3550;
  padding-right: 2.2rem;
}
.hp-enter:active { transform: scale(.97); }
.hp-enter i { font-size: .7rem; }
.hp-enter__lbl { display: inline-block; }

/* ═══════════════════════════════════════════════════════════════════
   HUD
═══════════════════════════════════════════════════════════════════ */
#heapHud {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--hud);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  padding: 0 clamp(.7rem, 1.8vw, 1.8rem);
  background: var(--g5);
  z-index: 9100;
}

#heapHud .inlab-hud__title {
  border-right: 1px solid rgba(255,255,255,.07);
  padding: 0 1.1rem;
}
#heapHud .inlab-hud__title-text {
  font-family: var(--sf);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  line-height: 1;
}
#heapHud .inlab-hud__title-text em {
  font-style: normal;
  color: var(--red);
}

/* Merkezi inlab-hud.css'i ez: ortala + KIRPMA (More-colors pop-up yukarı taşar) */
#heapHud .heap-hud__center,
.heap-hud__center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;   /* araç kümesi ortada */
  height: 100%;
  gap: 0;
  overflow: visible !important;         /* pop-up'ı kırpmasın */
  scrollbar-width: thin;
}
.heap-hud__center::-webkit-scrollbar { height: 3px; }
.heap-hud__center::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }
/* dar ekranda araçlar taşarsa yatay kaydır */
@media (max-width: 760px) {
  #heapHud .heap-hud__center,
  .heap-hud__center { overflow-x: auto !important; overflow-y: visible !important; }
}

.heap-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 .85rem;
  border-right: 1px solid rgba(255,255,255,.06);
  gap: .3rem;
  flex-shrink: 0;
}
.heap-seg:first-child {
  border-left: 1px solid rgba(255,255,255,.06);
}

.heap-lbl {
  font-family: var(--pp);
  font-size: .4rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  line-height: 1;
}

.heap-val {
  font-family: var(--sf);
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: .02em;
}
.heap-val--red   { color: var(--red); }
.heap-val--small { font-size: 1rem; letter-spacing: .04em; }

/* Progress — block-segment indicator */
.heap-seg--progress {
  min-width: 130px;
  max-width: 170px;
  align-items: center;
  gap: .35rem;
}
.heap-progress-dots {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 130px;
}
.heap-progress-dot {
  height: 8px;
  background: rgba(255,255,255,.08);
  transition: background .25s ease;
}
.heap-progress-dot.is-on { background: var(--red); }
.heap-progress-foot {
  display: flex;
  align-items: baseline;
  justify-content: center;
}
.heap-progress-frac {
  font-family: var(--sf);
  font-size: .82rem;
  color: #fff;
  letter-spacing: .02em;
}
.heap-bar-track {
  width: 70%;
  max-width: 140px;
  height: 2px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.heap-bar-fill {
  height: 100%;
  background: var(--red);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* Tool toggle (drop / erase / eyedrop / fill) */
.heap-seg--tool { padding: 0 .85rem; }
.heap-tool {
  display: flex;
  background: var(--g4);
}
.heap-tool-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: 0; outline: 0;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  font-size: .8rem;
  transition: background .15s ease, color .15s ease;
  padding: 0;
}
.heap-tool-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.heap-tool-btn.is-active {
  background: var(--red);
  color: #fff;
}

/* Shape picker — flat white icons, larger */
.heap-seg--shapes { padding: 0 .95rem; }
.heap-shapes {
  display: flex;
  gap: .35rem;
  align-items: center;
}
.heap-shape {
  width: 34px; height: 34px;
  cursor: pointer;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
  border: 1px solid transparent;
  outline: 0;
  padding: 0;
  opacity: .55;
  color: #fff;
  font-size: 1.05rem;
}
.heap-shape i { color: #fff; }
.heap-shape__cv {
  display: block;
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}
.heap-shape:hover {
  opacity: 1;
  transform: scale(1.10);
}
.heap-shape.is-active {
  opacity: 1;
  border-color: var(--red);
  transform: scale(1.10);
}

/* Color picker (also used for background) */
.heap-seg--colors { padding: 0 .85rem; }
.heap-colors {
  display: flex;
  gap: .3rem;
  align-items: center;
}
.heap-color {
  width: 22px; height: 22px;
  cursor: pointer;
  outline: 0;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: transform .15s ease, border-color .15s ease;
  position: relative;
  padding: 0;
}
.heap-color:hover { transform: scale(1.12); }
.heap-color.is-active {
  border-color: #fff;
  transform: scale(1.18);
}

/* Custom color slot — "+" add button + hidden native picker */
.heap-color--add {
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  border: 1px dashed rgba(255,255,255,.25);
  font-size: .55rem;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.heap-color--add:hover {
  color: #fff;
  border-color: rgba(255,255,255,.6);
  transform: scale(1.12);
}
.heap-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  overflow: hidden;
}
.heap-color--remove {
  position: absolute;
  top: -4px; right: -4px;
  width: 12px; height: 12px;
  background: var(--g5);
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  font-size: .35rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.heap-color-wrap {
  position: relative;
  display: inline-flex;
}
.heap-color-wrap:hover .heap-color--remove { display: inline-flex; }

/* ── Inline color bar (HUD) + popover for extras ────────── */
.heap-color-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.heap-color-defaults {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.heap-color-defaults .heap-color-sw {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,.22);
  background: #fff;
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: transform .12s ease, border-color .12s ease;
}
.heap-color-defaults .heap-color-sw:hover { transform: scale(1.12); }
.heap-color-defaults .heap-color-sw.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red, #E92038);
  transform: scale(1.1);
}

.heap-color-more {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px dashed rgba(255,255,255,.32);
  font-size: .55rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, transform .12s ease;
}
.heap-color-more:hover {
  color: #fff;
  border-color: rgba(255,255,255,.7);
  transform: scale(1.1);
}
.heap-color-more.is-open {
  color: #fff;
  border-style: solid;
  border-color: var(--red, #E92038);
}

/* Popover that floats just above the "+" button */
.heap-color-pop {
  position: absolute;
  bottom: calc(100% + 18px);
  right: 0;
  min-width: 264px;
  max-width: 300px;
  padding: 10px 12px 12px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 -4px 18px rgba(0,0,0,.55);
  display: none;
  z-index: 99999;   /* her şeyin üstünde */
}
.heap-color-pop.is-open { display: block; }
.heap-color-pop::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #0a0a0a;
  border-right: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
  transform: rotate(45deg);
}
.heap-color-pop__eyebrow {
  margin: 0 0 8px;
  font-family: 'Poppins', sans-serif;
  font-size: .42rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.heap-color-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}
.heap-color-pop__grid .heap-color-sw {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: transform .12s ease, border-color .12s ease;
}
.heap-color-pop__grid .heap-color-sw:hover { transform: scale(1.12); }
.heap-color-pop__grid .heap-color-sw.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red, #E92038);
  transform: scale(1.1);
}

/* ── Canvas bar: background colors + grid toggle (own HUD section) ── */
.heap-seg--canvas { padding: 0 .85rem; }
.heap-canvas-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.heap-bg-colors {
  display: flex;
  align-items: center;
  gap: 6px;
}
.heap-bg-colors .heap-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.heap-bg-colors .heap-color:hover { transform: scale(1.14); }
.heap-bg-colors .heap-color.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red, #E92038);
  transform: scale(1.08);
}
.heap-canvas-div {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}
.heap-grid-toggle {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.heap-grid-toggle:hover {
  color: #fff;
  border-color: rgba(255,255,255,.45);
}
.heap-grid-toggle.is-active {
  color: #fff;
  background: rgba(233,32,56,.16);
  border-color: var(--red, #E92038);
  box-shadow: 0 0 0 1px rgba(233,32,56,.4) inset;
}

/* ── Music bar: instrument picker + ambient/mute toggles ── */
.heap-seg--music { padding: 0 .85rem; }
.heap-music-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.heap-amb-toggle,
.heap-mute-toggle {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.heap-amb-toggle:hover,
.heap-mute-toggle:hover { color: #fff; border-color: rgba(255,255,255,.45); }
.heap-amb-toggle.is-active {
  color: #fff;
  background: rgba(123,97,255,.18);
  border-color: #7b61ff;
  box-shadow: 0 0 0 1px rgba(123,97,255,.45) inset;
  animation: heapAmbPulse 2.4s ease-in-out infinite;
}
@keyframes heapAmbPulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(123,97,255,.45) inset, 0 0 0 0 rgba(123,97,255,.0); }
  50%     { box-shadow: 0 0 0 1px rgba(123,97,255,.55) inset, 0 0 10px 2px rgba(123,97,255,.35); }
}
.heap-mute-toggle.is-muted {
  color: #ff6b7e;
  border-color: rgba(233,32,56,.5);
}

/* Brush size picker */
.heap-seg--brush { padding: 0 .85rem; }
.heap-brush {
  display: flex;
  gap: .25rem;
  align-items: center;
}
.heap-brush-btn {
  width: 26px; height: 26px;
  font-family: var(--sf);
  font-size: .9rem;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.04);
  border: 0; outline: 0;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  padding: 0;
}
.heap-brush-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.heap-brush-btn.is-active { background: var(--red); color: #fff; }

/* Buttons */
.heap-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  padding: .35rem .7rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  color: rgba(255,255,255,.55);
  transition: background .18s, color .18s, border-color .18s;
  font-family: var(--pp);
  white-space: nowrap;
}
.heap-btn:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}
.heap-btn.is-active {
  background: rgba(233,32,56,.1);
  border-color: rgba(233,32,56,.5);
  color: var(--red);
}
.heap-btn i { font-size: .82rem; }
.heap-btn__lbl {
  font-size: .32rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1;
  opacity: .8;
}
.heap-btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,.08);
}
.heap-btn--danger:hover {
  background: rgba(233,32,56,.12);
  border-color: rgba(233,32,56,.5);
  color: var(--red);
}

/* Archive — solid red CTA, double width */
.heap-btn--archive {
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff;
  min-width: 140px;
  padding: .35rem 1.1rem;
}
.heap-btn--archive .heap-btn__lbl { opacity: 1; color: #fff; }
.heap-btn--archive i { color: #fff; }
.heap-btn--archive:hover {
  background: #ff3550;
  border-color: #ff3550;
  color: #fff;
}

/* Hidden BG container — JS init compatibility */
.heap-bg-hidden { display: none !important; }

/* Right actions */
#heapHud .inlab-hud__actions {
  border-left: 1px solid rgba(255,255,255,.06);
  padding: 0 .85rem;
  gap: .35rem;
}
#heapHud .inlab-hud__info-btn {
  width: 38px; height: 38px;
}

/* ═══════════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════════ */
.heap-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2,2,2,.82);
  backdrop-filter: blur(8px);
}
.heap-modal.is-open { display: flex; }
.heap-modal__card {
  background: var(--g5);
  padding: 2.2rem 2.4rem;
  width: calc(100% - 2rem);
  max-width: 520px;
  text-align: center;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
}
.heap-modal__close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: transparent;
  border: 0; outline: 0;
  color: rgba(255,255,255,.4);
  font-size: 1rem;
  cursor: pointer;
  padding: .35rem .55rem;
  transition: color .2s;
  z-index: 1;
}
.heap-modal__close:hover { color: #fff; }
.heap-eyebrow {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .6rem;
}
.heap-modal__title {
  font-family: var(--sf);
  font-size: 2.2rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  margin-bottom: .6rem;
  line-height: 1;
}
.heap-modal__title em { font-style: normal; color: var(--red); }
.heap-modal__sub {
  font-family: var(--pp);
  font-size: .54rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.6rem;
  line-height: 1.5;
}
.heap-modal__actions {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.heap-modal__btn {
  font-family: var(--pp);
  font-size: .55rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  padding: .7rem 1.3rem;
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.heap-modal__btn:hover {
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.heap-modal__btn i { font-size: .72rem; }
.heap-modal__btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.heap-modal__btn--primary:hover {
  background: #ff3550;
  border-color: #ff3550;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   SETTINGS PANEL
═══════════════════════════════════════════════════════════════════ */
.heap-settings { padding: 2rem 2.2rem; text-align: left; }
.heap-set-grid {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}
.heap-set-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.4rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.heap-set-row:last-child { border-bottom: none; }
.heap-set-row__lbl strong {
  display: block;
  font-family: var(--sf);
  font-size: 1.05rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: .2rem;
}
.heap-set-row__lbl span {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
  line-height: 1.5;
}

/* Pill group (segmented control) */
.heap-pill-group {
  display: inline-flex;
  background: var(--g4);
}
.heap-pill {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  background: transparent;
  border: 0; outline: 0;
  padding: .55rem .9rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.heap-pill:hover { color: #fff; background: rgba(255,255,255,.05); }
.heap-pill.is-active {
  background: var(--red);
  color: #fff;
}

/* Volume slider */
.heap-slider-row {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  min-width: 220px;
}
.heap-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 4px;
  background: rgba(255,255,255,.1);
  outline: 0;
  cursor: pointer;
}
.heap-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  background: var(--red);
  cursor: pointer;
  border: 0;
}
.heap-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--red);
  cursor: pointer;
  border: 0;
}
.heap-slider-val {
  font-family: var(--sf);
  font-size: 1rem;
  color: #fff;
  letter-spacing: .04em;
  min-width: 52px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   SAVE MODAL
═══════════════════════════════════════════════════════════════════ */
.heap-save { max-width: 640px; padding: 2rem 2.2rem; }
.heap-save-preview {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1rem auto;
  background: var(--g4);
  border: 1px solid rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.heap-save-preview canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}
.heap-save-meta {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 1.2rem;
  display: flex;
  gap: .55rem;
  justify-content: center;
  align-items: center;
}
.heap-save-meta strong { color: var(--red); font-weight: 600; }
.heap-dot-sep { color: rgba(255,255,255,.25); }

.heap-input-wrap {
  display: block;
  text-align: left;
  margin-bottom: 1.2rem;
}
.heap-input-lbl {
  display: block;
  font-family: var(--pp);
  font-size: .38rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
  margin-bottom: .4rem;
}
.heap-input {
  width: 100%;
  background: var(--g4);
  border: 1px solid rgba(255,255,255,.08);
  outline: 0;
  font-family: var(--pp);
  font-size: .58rem;
  letter-spacing: .04em;
  color: #fff;
  padding: .7rem .85rem;
  transition: border-color .18s ease;
}
.heap-input:focus { border-color: var(--red); }

.heap-save-actions {
  display: flex;
  gap: .55rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.heap-save-foot {
  font-family: var(--pp);
  font-size: .38rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
}

/* ═══════════════════════════════════════════════════════════════════
   ARCHIVE GALLERY
═══════════════════════════════════════════════════════════════════ */
.heap-archive { max-width: 880px; padding: 2rem 2.2rem 2.4rem 2.2rem; }
.heap-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .55rem;
  margin-top: 1rem;
  align-items: start;
}
.heap-arch-item {
  background: var(--g4);
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  text-align: left;
  padding: 0;
  outline: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color .18s ease, transform .18s ease;
}
.heap-arch-item:hover {
  border-color: var(--red);
}
.heap-arch-item__thumb {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  background: #060606;
}
.heap-arch-item__meta {
  padding: .55rem .65rem .65rem .65rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.heap-arch-item__title {
  font-family: var(--sf);
  font-size: .85rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heap-arch-item__sub {
  font-family: var(--pp);
  font-size: .35rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.heap-archive-empty {
  font-family: var(--pp);
  font-size: .5rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin: 2rem 0 .5rem 0;
}

/* ═══════════════════════════════════════════════════════════════════
   DETAIL MODAL
═══════════════════════════════════════════════════════════════════ */
.heap-detail { max-width: 640px; padding: 2rem 2.2rem; }
.heap-detail-img-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 1.2rem auto;
  background: var(--g4);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.heap-detail-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

/* ═══════════════════════════════════════════════════════════════════
   TOOLTIPS — BRIEF BREAKER style
═══════════════════════════════════════════════════════════════════ */
[data-tip] {
  position: relative;
}
[data-tip]::before,
[data-tip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  transform: translate(-50%, 4px);
  z-index: 9700;
}
[data-tip]::before {
  content: attr(data-tip);
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #fff;
  background: var(--g5);
  padding: .55rem .85rem;
  white-space: nowrap;
  border-left: 2px solid var(--red);
}
[data-tip]::after {
  content: '';
  width: 0; height: 0;
  border: 4px solid transparent;
  border-top-color: var(--g5);
  margin-left: -4px;
  bottom: calc(100% + 2px);
}
[data-tip]:hover::before,
[data-tip]:hover::after,
[data-tip]:focus-visible::before,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════════ */
.heap-toast {
  position: fixed;
  bottom: calc(var(--hud) + 60px);
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--g5);
  color: #fff;
  font-family: var(--pp);
  font-size: .5rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: .65rem 1.1rem;
  z-index: 9600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  border-left: 2px solid var(--red);
}
.heap-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .heap-seg--progress { display: none; }
  .heap-seg .heap-val { font-size: 1.2rem; }
}

@media (max-width: 900px) {
  .heap-shape, .heap-brush-btn { width: 22px; height: 22px; font-size: .85rem; }
  .heap-color { width: 18px; height: 18px; }
  .heap-set-row { grid-template-columns: 1fr; gap: .6rem; }
}

@media (max-width: 720px) {
  :root { --hud: 58px; }  /* mobilde merkezi HUD ile aynı */
  #heapHud { padding: 0 .4rem; grid-template-columns: 1fr auto; }
  #heapHud .inlab-hud__title { display: none; }
  .heap-seg { padding: 0 .55rem; }
  .heap-btn__lbl { display: none; }
  
  .hp-guide { flex-direction: column; }
  .hp-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); }
  .hp-item:last-child { border-bottom: none; }
  .heap-archive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .heap-seg .heap-lbl { font-size: .38rem; }
  .heap-seg .heap-val { font-size: 1rem; }
  .heap-color { width: 16px; height: 16px; }
  .heap-shape, .heap-brush-btn { width: 20px; height: 20px; font-size: .8rem; }
}
