/* ==========================================================================
   styles.css — Awwwards Botanical Editorial Minimalism (v3.0)
   • Matematyczne wyrównanie jednej osi symetrii dla: światła tła, znaku wodnego,
     plakietki fenotypu, okazu 3D WebGL oraz dolnego doku sterowania
   • 3-kolumnowa siatka górnego paska — przełącznik slajdów idealnie w centrum
   • Czytelne karty I i II Prawa Mendla, szlak Gen → Enzym → Komórka → Fenotyp
   ========================================================================== */
:root {
  --ink: #f3ebde;
  --muted: #b0a290;
  --dim: #7c7163;
  --gold: #d2ab6e;
  --gold-bright: #ebd09e;
  --gold-soft: rgba(210, 171, 110, 0.36);
  --danger: #e4646d;
  --line: rgba(243, 235, 222, 0.10);
  --line-strong: rgba(243, 235, 222, 0.20);
  --glass: linear-gradient(165deg, rgba(32, 26, 22, 0.93), rgba(16, 13, 11, 0.96));
  --glass-soft: linear-gradient(165deg, rgba(36, 29, 24, 0.84), rgba(18, 15, 12, 0.88));
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --edge: 20px;
  --drawer-w: 368px;
  --drawer-inset: 406px;
  --stage-offset: 0px;
}

@media (min-width: 1020px) {
  body.has-left-drawer:not(.has-right-drawer) { --stage-offset: 193px; }
  body.has-right-drawer:not(.has-left-drawer) { --stage-offset: -193px; }
}

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

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #100d0b;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------- tło studyjne + znak wodny zsynchronizowany z osią 3D ---------------- */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 68% at calc(50% + var(--stage-offset)) 46%, #3f2d25 0%, #1e1713 52%, #0e0b09 100%);
  transition: background 0.45s ease;
}
.bg-layer.is-pea {
  opacity: 0;
  background: radial-gradient(ellipse 60% 68% at calc(50% + var(--stage-offset)) 46%, #2e3823 0%, #171c12 52%, #0b0d09 100%);
}
#bg-roman {
  position: fixed;
  left: calc(50% + var(--stage-offset));
  top: 47%;
  transform: translate(-50%, -50%);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(200px, 46vh, 460px);
  line-height: 1;
  color: rgba(243, 235, 222, 0.028);
  pointer-events: none;
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.50) 100%);
}

/* ---------------- płótno WebGL ---------------- */
#gl-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}
#gl-canvas.is-grabbing { cursor: grabbing; }

/* ---------------- warstwa UI ---------------- */
.ui-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ---------------- górny pasek (symetryczna siatka 1fr auto 1fr) ---------------- */
.top-bar {
  position: absolute;
  top: 14px;
  left: var(--edge);
  right: var(--edge);
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--gold);
  background: rgba(20, 16, 13, 0.72);
  flex: none;
}
.brand-text b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.brand-text small {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

.slide-switch {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 14, 11, 0.84);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.slide-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 17px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: #c8baa6;
  border: 1px solid transparent;
  background: transparent;
  transition: color 0.22s, background 0.22s, border-color 0.22s, box-shadow 0.22s;
  white-space: nowrap;
}
.slide-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.slide-btn i {
  font-style: normal;
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--gold);
}
.slide-btn.is-active {
  background: linear-gradient(135deg, rgba(232, 206, 170, 0.23), rgba(210, 171, 110, 0.33));
  border-color: rgba(226, 190, 134, 0.68);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.38), 0 0 14px rgba(210, 171, 110, 0.20);
  font-weight: 500;
}
.slide-btn.is-active i {
  color: var(--gold-bright);
}
.slide-label-short { display: none; }
@media (max-width: 1200px) {
  .slide-label-full { display: none; }
  .slide-label-short { display: inline; }
}

.drawer-triggers {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--glass-soft);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #e2d7c6;
  transition: border-color 0.22s, background 0.22s, transform 0.18s;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.30);
  white-space: nowrap;
}
.drawer-btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.drawer-btn.is-open {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.20);
  color: #fff;
}
.drawer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(210, 171, 110, 0.45);
  transition: background 0.2s, box-shadow 0.2s;
}
.drawer-btn.is-open .drawer-dot {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold);
}

/* ---------------- plakietka fenotypu nad sceną 3D ---------------- */
.hero-placard {
  position: absolute;
  top: 68px;
  left: var(--edge);
  right: var(--edge);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: min(580px, 90vw);
  pointer-events: none;
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1), right 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 1020px) {
  body.has-left-drawer .hero-placard { left: var(--drawer-inset); }
  body.has-right-drawer .hero-placard { right: var(--drawer-inset); }
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 16, 13, 0.82);
  margin-bottom: 5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.badge-sw {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}
.badge-geno {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.03em;
}
.badge-sep {
  width: 1px;
  height: 11px;
  background: var(--line-strong);
}
.badge-tag {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(25px, 2.85vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.72);
}
.hero-summary {
  margin: 6px auto 0;
  max-width: 540px;
  font-size: 12px;
  line-height: 1.48;
  font-weight: 400;
  color: #d6c9b6;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}

/* ---------------- kolory alleli i ikona grochu ---------------- */
.al { font-family: var(--serif); font-weight: 600; }
.al-D { color: #f6dca2; }
.al-r { color: #d8cab6; font-style: italic; font-weight: 400; }
.al-L { color: var(--danger); }
.al-wt { color: #a3cf8b; }
.al-sep { color: var(--dim); margin: 0 1px; }

.pea-mini {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.34) inset;
}
.pea-mini.is-y { background: radial-gradient(circle at 35% 30%, #fff2b2, #e2bd3f 62%, #9e7b18); }
.pea-mini.is-g { background: radial-gradient(circle at 35% 30%, #d8f0a0, #79a336 62%, #44631b); }
.pea-mini.is-w {
  border-radius: 43% 57% 41% 59% / 57% 43% 57% 43%;
  box-shadow: inset 2px -1px 0 rgba(0, 0, 0, 0.38), inset -2px 2px 0 rgba(0, 0, 0, 0.25);
}

/* ---------------- pływający dok na dole (zero obcinania kapsuł!) ---------------- */
.bottom-dock {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  margin-left: auto;
  margin-right: auto;
  bottom: 16px;
  width: auto;
  max-width: 720px;
  padding: 11px 16px 10px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1), right 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 1020px) {
  body.has-left-drawer .bottom-dock { left: var(--drawer-inset); }
  body.has-right-drawer .bottom-dock { right: var(--drawer-inset); }
}

.dock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.parent-slots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.parent-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
  padding: 5px 11px;
  border-radius: 12px;
  border: 1px dashed rgba(210, 171, 110, 0.38);
  background: rgba(210, 171, 110, 0.05);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.parent-slot:hover {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.10);
}
.parent-slot.is-target {
  border-style: solid;
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.15);
  box-shadow: 0 0 0 1px rgba(210, 171, 110, 0.24);
}
.parent-slot.is-magnet {
  border-style: solid;
  border-color: #fff;
  background: rgba(210, 171, 110, 0.30);
  box-shadow: 0 0 22px rgba(210, 171, 110, 0.48);
}
.slot-sex {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold);
}
.slot-sw {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  flex: none;
}
.slot-meta strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.slot-meta small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
}
.slot-swap {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  display: grid;
  place-items: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex: none;
}
.slot-swap:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.12);
}

/* paski pomocnicze (loci róży / presety i mutacje grochu) */
.sub-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sub-bar[hidden] { display: none !important; }

.locus-chip, .mut-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.045);
  font-size: 10.5px;
  color: #dad0bf;
  transition: border-color 0.18s, background 0.18s;
  white-space: nowrap;
}
.locus-chip:hover, .mut-chip:hover {
  border-color: var(--gold-soft);
  background: rgba(243, 235, 222, 0.09);
}
.locus-chip.is-active, .mut-chip.is-active {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.17);
  color: var(--ink);
}
.locus-chip.is-lethal {
  border-color: rgba(228, 100, 109, 0.68);
  background: rgba(228, 100, 109, 0.18);
}
.lc-k { font-size: 10px; color: var(--muted); }
.locus-chip.is-active .lc-k { color: #e6d7c0; }
.lc-v { font-family: var(--serif); font-size: 13.5px; }

.mut-sep { width: 1px; height: 15px; background: var(--line-strong); margin: 0 2px; }
.mut-chip.is-danger { border-color: rgba(228, 100, 109, 0.42); color: #f2adb2; }
.mut-chip.is-danger.is-on { background: rgba(228, 100, 109, 0.24); border-color: var(--danger); color: #fff; }
.mut-chip.is-ghost.is-on { background: rgba(230, 236, 240, 0.22); border-color: #d8e2e6; color: #fff; }

/* rząd kapsuł genowych — pełna widoczność z estetycznym zawijaniem (zero uciętych przycisków) */
.pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.gene-pill {
  touch-action: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(243, 235, 222, 0.06);
  font-size: 11px;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
  cursor: grab;
}
.gene-pill:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(243, 235, 222, 0.12);
}
.gene-pill.is-gamete { padding: 6px 14px; }
.gene-pill.is-active {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.20);
}
.pill-sw {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  flex: none;
}
.pill-name { font-weight: 500; color: var(--ink); }
.pill-geno { font-family: var(--serif); font-size: 13px; color: var(--muted); }

.pill-ghost, .pill-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  pointer-events: none;
  border-color: var(--gold) !important;
  background: rgba(34, 28, 24, 0.96) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  transition: none !important;
}

.dock-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--muted);
  gap: 10px;
  padding-top: 2px;
  border-top: 1px solid rgba(243, 235, 222, 0.06);
}
.dock-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.stage-mini-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(243, 235, 222, 0.05);
  font-size: 10px;
  color: #dfd3c0;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  white-space: nowrap;
}
.stage-mini-btn:hover {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.16);
  color: #fff;
}
.stage-mini-btn[hidden] { display: none !important; }
.perf-pill { font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; }
.perf-pill b { color: var(--muted); font-weight: 500; }

/* ---------------- panele boczne (Lewy: Szachownica Punnetta, Prawy: Wyjaśnienie i Biochemia) ---------------- */
.side-drawer {
  position: absolute;
  top: 68px;
  bottom: 16px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.64);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s;
  opacity: 0;
  z-index: 10;
}
.side-drawer.is-left {
  left: var(--edge);
  width: min(var(--drawer-w), calc(100vw - 32px));
  transform: translateX(calc(-100% - 30px));
}
.side-drawer.is-right {
  right: var(--edge);
  width: min(var(--drawer-w), calc(100vw - 32px));
  transform: translateX(calc(100% + 30px));
}
.side-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
}

.drawer-head {
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.drawer-kicker {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
  font-weight: 500;
}
.drawer-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.1;
}
.drawer-sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.drawer-close {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  display: grid;
  place-items: center;
  flex: none;
  transition: color 0.18s, border-color 0.18s;
}
.drawer-close:hover { color: var(--ink); border-color: var(--gold); }

.drawer-body {
  padding: 12px 15px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 235, 222, 0.20) transparent;
}
.drawer-body::-webkit-scrollbar { width: 5px; }
.drawer-body::-webkit-scrollbar-thumb { background: rgba(243, 235, 222, 0.20); border-radius: 4px; }

/* ---------------- Presety klasycznych doświadczeń Mendla w szachownicy ---------------- */
.p-section-lbl {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.p-preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.p-preset-btn {
  flex: 1 1 auto;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.035);
  font-size: 10.5px;
  color: #d6c8b4;
  text-align: center;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  white-space: nowrap;
}
.p-preset-btn:hover {
  border-color: var(--gold-soft);
  background: rgba(243, 235, 222, 0.08);
  color: #fff;
}
.p-preset-btn.is-active {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.20);
  color: #fff;
  font-weight: 500;
}

.p-pea-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
}

/* Zakładki 5 genów róży */
.p-locus-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 9px;
}
.p-locus-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.035);
  transition: border-color 0.18s, background 0.18s;
}
.p-locus-tab:hover {
  border-color: var(--gold-soft);
  background: rgba(243, 235, 222, 0.07);
}
.p-locus-tab.is-active {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.18);
  box-shadow: 0 0 0 1px rgba(210, 171, 110, 0.24) inset;
}
.p-locus-tab b {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink);
}
.p-locus-tab span {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Przełączniki alleli rodziców ♀ × ♂ nad siatką 2×2 */
.p-parents-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.03);
  margin-bottom: 10px;
}
.p-parent-ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.p-parent-lbl {
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-Allele-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.p-al-btn {
  padding: 3px 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.04);
  font-size: 12.5px;
  transition: background 0.16s, border-color 0.16s;
}
.p-al-btn:hover { border-color: var(--gold-soft); }
.p-al-btn.is-on {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.22);
}
.p-cross-sign {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--muted);
  padding: 0 2px;
}

/* Siatka Punnetta (2×2, 4×4, 4×1, 1×1) */
.p-grid {
  display: grid;
  grid-template-columns: 46px repeat(var(--cols, 4), 1fr);
  gap: 5px;
}
.p-grid.is-rose-2x2 {
  grid-template-columns: 52px repeat(2, 1fr);
  gap: 7px;
}
.p-grid.is-pea-4x1 {
  grid-template-columns: 58px 1fr;
  gap: 6px;
}
.p-grid.is-pea-1x1 {
  grid-template-columns: 58px 1fr;
  gap: 7px;
}
.p-head {
  min-height: 34px;
  border-radius: 9px;
  background: rgba(243, 235, 222, 0.035);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--serif);
  font-size: 14.5px;
}
.p-head small {
  font-size: 10.5px;
  color: var(--gold);
  font-style: normal;
}
.p-head.is-clickable:hover {
  border-color: var(--gold-soft);
  background: rgba(210, 171, 110, 0.13);
}
.p-head.is-active-gamete {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.20);
  color: var(--ink);
}
.p-corner { font-size: 10.5px; font-style: italic; color: var(--muted); }

.p-cell {
  min-height: 50px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  transition: background 0.18s, border-color 0.18s, transform 0.14s, box-shadow 0.18s;
}
.p-cell.is-large {
  min-height: 66px;
  gap: 5px;
}
.p-cell.is-wide {
  flex-direction: row;
  justify-content: space-between;
  padding: 8px 14px;
  min-height: 46px;
}
.p-cell-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.p-pheno-name {
  font-size: 10.5px;
  color: #d8cab6;
  font-weight: 400;
}
.p-cell:hover {
  background: rgba(243, 235, 222, 0.10);
  transform: translateY(-1px);
}
.p-cell.is-match {
  border-color: var(--gold-soft);
  background: rgba(210, 171, 110, 0.08);
}
.p-cell.is-sel {
  border-color: var(--gold);
  background: rgba(210, 171, 110, 0.22);
  box-shadow: 0 0 0 1px var(--gold) inset;
}
.p-cell.is-hover-hi {
  border-color: var(--gold-bright) !important;
  background: rgba(210, 171, 110, 0.28) !important;
  box-shadow: 0 0 14px rgba(210, 171, 110, 0.30);
}
.p-cell.is-lethal { border-color: rgba(228, 100, 109, 0.52); }
.p-sw { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset; flex: none; }
.p-lbl { font-size: 13.5px; line-height: 1; }
.p-cell.is-large .p-lbl { font-size: 16.5px; }

/* Blok rozszczepienia fenotypów i genotypów */
.ratio-block {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.ratio-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--muted);
}
.ratio-head strong {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-bright);
  font-weight: 600;
}
.geno-ratio-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(243, 235, 222, 0.03);
  border: 1px solid rgba(243, 235, 222, 0.06);
}
.geno-ratio-line b {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.ratio-bar {
  display: flex;
  height: 7px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 8px;
  background: rgba(243, 235, 222, 0.06);
}
.ratio-bar span { display: block; height: 100%; transition: flex 0.3s ease; }
.ratio-list { display: grid; gap: 4px; }
.ratio-row {
  width: 100%;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 11px;
  color: #cfc2ae;
  text-align: left;
  transition: background 0.16s, border-color 0.16s;
}
.ratio-row.is-btn:hover { background: rgba(243, 235, 222, 0.07); border-color: var(--line-strong); }
.ratio-row.is-on {
  background: rgba(210, 171, 110, 0.16);
  border-color: var(--gold-soft);
  color: var(--ink);
}
.r-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset; }
.r-frac { font-family: var(--serif); font-size: 13.5px; color: var(--ink); white-space: nowrap; }

/* Karta wyjaśnienia Prawa Mendla w lewym panelu */
.mendel-law-box {
  margin-top: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(210, 171, 110, 0.30);
  background: linear-gradient(145deg, rgba(210, 171, 110, 0.10), rgba(210, 171, 110, 0.03));
}
.mlb-kicker {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
  font-weight: 600;
}
.mendel-law-box h4 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.mendel-law-box p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #d6c9b6;
}
.open-bio-btn {
  margin-top: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--gold-soft);
  background: rgba(210, 171, 110, 0.14);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--gold-bright);
  text-align: center;
  transition: background 0.18s, border-color 0.18s;
}
.open-bio-btn:hover {
  background: rgba(210, 171, 110, 0.25);
  border-color: var(--gold);
  color: #fff;
}

/* ---------------- zawartość prawego panelu (Wyjaśnienie i Biochemia) ---------------- */
.bio-law-banner {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(210, 171, 110, 0.34);
  background: linear-gradient(150deg, rgba(210, 171, 110, 0.13), rgba(210, 171, 110, 0.03));
  margin-bottom: 12px;
}
.bio-law-banner span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
  font-weight: 600;
}
.bio-law-banner h4 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: #fff;
}
.bio-law-banner p {
  margin: 0;
  font-size: 11px;
  line-height: 1.52;
  color: #dcd0be;
}

/* 4-krokowy szlak przyczynowy: Genotyp -> Enzym -> Komórka -> Fenotyp */
.bio-pathway {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.bp-step {
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(243, 235, 222, 0.035);
}
.bp-step small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.bp-step strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.bio-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  margin-bottom: 13px;
}
.bm-top {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.bm-top b { color: var(--ink); font-weight: 500; }
.bm-track {
  height: 5px;
  border-radius: 4px;
  background: rgba(243, 235, 222, 0.08);
  overflow: hidden;
}
.bm-track i { display: block; height: 100%; border-radius: 4px; transition: width 0.5s; }

.bio-loci { display: grid; gap: 7px; margin-bottom: 12px; }
.bio-locus {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(243, 235, 222, 0.04);
  border: 1px solid var(--line);
}
.bl-sym {
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
}
.bio-locus strong { display: block; font-size: 11.5px; margin-bottom: 2px; }
.bio-locus p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.45; }

.bio-cards { display: grid; gap: 8px; }
.bio-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(243, 235, 222, 0.04);
  border: 1px solid var(--line);
}
.bc-tag {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
  font-weight: 600;
}
.bio-card h4 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 500;
}
.bio-card p {
  margin: 0;
  font-size: 11.2px;
  line-height: 1.56;
  color: #d2c5b2;
  font-weight: 400;
}
.bio-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(210, 171, 110, 0.28);
  background: rgba(210, 171, 110, 0.08);
  font-size: 11px;
  line-height: 1.5;
  color: #e6d7be;
}
.bio-fact {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  background: rgba(210, 171, 110, 0.06);
  border-radius: 0 10px 10px 0;
}
.bio-fact span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
  font-weight: 600;
}
.bio-fact p { margin: 0; font-size: 11px; line-height: 1.5; color: #dacdb9; }

.bio-glossary {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}
.bio-glossary summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 500;
}
.bio-glossary dl { margin: 8px 0 0; }
.bio-glossary dt { font-weight: 600; color: var(--ink); margin-top: 6px; font-size: 11.5px; }
.bio-glossary dd { margin: 2px 0 0; color: var(--muted); line-height: 1.48; font-size: 11px; }
.bio-disc { margin: 10px 0 0; font-size: 10px; color: var(--dim); line-height: 1.45; }

/* ---------------- pływający dymek (tooltip) ---------------- */
.floater-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 250;
  max-width: 270px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 13, 11, 0.96);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.floater-tip.is-vis { opacity: 1; }

/* ---------------- responsywność ---------------- */
@media (max-width: 1019px) {
  .brand-text small { display: none; }
  .top-bar { top: 10px; left: 12px; right: 12px; }
  .drawer-btn span:not(.drawer-dot) { display: none; }
  .drawer-btn::after { content: attr(data-short); }
  .hero-placard { top: 62px; left: 12px; right: 12px; max-width: 100%; }
  .bottom-dock { left: 12px; right: 12px; bottom: 10px; max-width: 100%; }
  .side-drawer { top: 58px; bottom: 10px; z-index: 25; width: min(380px, calc(100vw - 24px)); }
  .side-drawer.is-left { left: 12px; }
  .side-drawer.is-right { right: 12px; }
  #dock-mode-label { display: none; }
  .dock-foot { justify-content: flex-end; }
}
