/* Experimente-Labor – Bausatz (Entwurf 16.10.2026)
 * Premium-Graffiti im App-Modus: Wand, Slap, Plakat, Piece, Stencil, Sticker, Stamp, MarkerLine, TagButton.
 * EINE Farbquelle (:root), EINE Takttabelle (--t-*), bewegt werden nur transform und opacity. */

:root {
  /* Farbrollen (dunkel) */
  --ink: #07080d;
  --night: #0d0f17;
  --wall: #171b26;
  --wall-hi: #232a3a;
  --sunk: #10131b;
  --line: #2f3648;
  --bone: #f3eee3;
  --smoke: #9aa1b5;
  --paper: #efe8d8;
  --paper-2: #e3dac6;
  --paper-ink: #15161c;
  --paper-smoke: #5b5a62;
  --core: #ff5b1f;
  --acid: #c9ff2b;
  --hot: #ff2e63;
  --uv: #a57bff;
  --ice: #38e1ff;
  --gold: #ffc53a;
  --laser: #ff3b2f;

  /* Fächer – Farbe je Wert aus EINER Tabelle */
  --c-phy: #38e1ff;
  --c-che: #a57bff;
  --c-bio: #5fd38a;
  --c-mat: #ff8a3d;
  --c-geo: #4f8dff;
  --c-his: #d6a26a;

  /* Größen und Stoffe – feste Farbe je Wert (Formeln, Merksätze, Knöpfe) */
  --q-a: var(--ice);
  --q-b: var(--uv);
  --m-luft: #aab3c5;
  --m-wasser: #5b9dff;
  --m-glas: #3fd6a6;
  --m-diamant: #ff6fb0;
  --m-on: #07080d;
  --q-crit: #ff5b6e;

  /* Schriften – vier Rollen */
  --f-piece: 'Sedgwick Ave Display', 'Permanent Marker', Impact, sans-serif;
  --f-marker: 'Permanent Marker', 'Comic Sans MS', cursive;
  --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-label: 'Chakra Petch', ui-monospace, monospace;
  --f-text: 'Inter', ui-sans-serif, system-ui, sans-serif;

  /* Takttabelle */
  --t-exit: 180ms;
  --t-enter: 480ms;
  --t-stagger: 70ms;
  --t-letter: 52ms;
  --t-cut: 420ms;
  --t-press: 90ms;
  --ease-out: cubic-bezier(.2, .9, .25, 1);
  --ease-in: cubic-bezier(.5, 0, .9, .4);
  --ease-pop: linear(0, .42 12%, .86 24%, 1.07 38%, 1.02 52%, .99 66%, 1);
  --ease-snap: linear(0, .55 15%, .95 32%, 1.03 48%, 1);

  color-scheme: dark;
}

/* Hell (Variante C und helles Farbdesign) */
.theme-hell {
  --ink: #15161c;
  --night: #e9e3d4;
  --wall: #fbf8f0;
  --wall-hi: #ffffff;
  --sunk: #efe9db;
  --line: #cfc6b2;
  --bone: #15161c;
  --smoke: #5d5c66;
  --paper: #fffdf7;
  --paper-2: #f4eedf;
  --paper-ink: #15161c;
  --c-phy: #0098c7;
  --ice: #0098c7;
  --uv: #7a4fe0;
  --gold: #ffb81c;
  color-scheme: light;
}
.theme-hell, .slap--paper {
  --q-a: #0087b3;
  --q-b: #6b3fd8;
  --m-luft: #667085;
  --m-wasser: #2563eb;
  --m-glas: #0b9a72;
  --m-diamant: #d1306f;
  --m-on: #ffffff;
  --q-crit: #d1283c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--f-text);
  color: var(--bone);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Wand ---------- */
.wall {
  background-color: var(--night);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 80% at 15% 0%, rgba(56, 225, 255, .05), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(255, 91, 31, .05), transparent 60%);
}
.theme-hell .wall, .theme-hell.wall {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* alte Tags in der Wand – statisch, blass */
.wall-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.wall-tags svg { position: absolute; opacity: .07; }
.wall-tags path { fill: none; stroke: var(--bone); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Slap ---------- */
.slap {
  --rot: -.4deg;
  --off: 6px;
  position: relative;
  background-color: var(--wall);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  border: 3px solid var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--off) var(--off) 0 0 var(--ink);
  transform: rotate(var(--rot));
}
.slap--paper {
  background-color: var(--paper);
  color: var(--paper-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .2 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.slap--sunk {
  background-color: var(--sunk);
  box-shadow: inset 4px 4px 0 var(--ink);
  transform: none;
}
.slap--flat { box-shadow: none; transform: none; }
/* Art-Kante: kurze gerade Kante in der Farbe der Sache (kein Klebeband) */
.slap[data-edge]::before {
  content: '';
  position: absolute;
  left: 14px;
  top: -3px;
  width: 46px;
  height: 6px;
  background: var(--edge, var(--ice));
  border: 2px solid var(--ink);
}

/* ---------- Piece (gezeichnetes Wort, geschichtet) ---------- */
.piece {
  --fill-a: var(--gold);
  --fill-b: var(--core);
  --fill-c: var(--hot);
  display: inline-flex;
  align-items: flex-end;
  font-family: var(--f-piece);
  font-weight: 400;
  line-height: .95;
  letter-spacing: 0;
  white-space: nowrap;
  position: relative;
  isolation: isolate;
  margin: 0;
}
.piece .l {
  position: relative;
  display: inline-block;
  margin-right: -.05em;
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg));
}
.piece .l b { font-weight: inherit; display: block; }
.piece .l .s, .piece .l .f, .piece .l .g { position: absolute; inset: 0; }
.piece .l .s {
  color: var(--ink);
  -webkit-text-stroke: .2em var(--ink);
  transform: translate(.07em, .09em);
  z-index: -2;
}
.piece .l .o {
  color: var(--ink);
  -webkit-text-stroke: .13em var(--ink);
  z-index: -1;
  position: relative;
}
.piece .l .f {
  background: linear-gradient(180deg, var(--fill-a) 8%, var(--fill-b) 55%, var(--fill-c) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.piece .l .g {
  background: linear-gradient(172deg, rgba(255, 255, 255, .92) 0 26%, rgba(255, 255, 255, 0) 27%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  clip-path: inset(6% 30% 52% 14%);
}
.piece--cool { --fill-a: #e9fbff; --fill-b: var(--ice); --fill-c: var(--uv); }
.piece--chrome { --fill-a: #ffffff; --fill-b: #c9cfdc; --fill-c: #7d859a; }
.piece--marker { --fill-a: #ff9b6a; --fill-b: var(--core); --fill-c: #d8321a; }

/* ---------- Stencil (Zahlen, Kurzwörter) ---------- */
.stencil {
  font-family: var(--f-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  line-height: .9;
  -webkit-mask-image: linear-gradient(180deg, #000 0 47%, transparent 47% 53%, #000 53%);
  mask-image: linear-gradient(180deg, #000 0 47%, transparent 47% 53%, #000 53%);
}
.label {
  font-family: var(--f-label);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--smoke);
}
.marker-note {
  font-family: var(--f-marker);
  color: var(--smoke);
  transform: rotate(-1.5deg);
}

/* ---------- Sticker / Stamp ---------- */
.sticker {
  --st-bg: var(--wall-hi);
  --st-fg: var(--bone);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 2px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--st-fg);
  background: var(--st-bg);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(var(--rot, -1.2deg));
  white-space: nowrap;
}
.sticker--tone { --st-bg: var(--tone); --st-fg: var(--ink); }
.sticker--ok { --st-bg: var(--acid); --st-fg: var(--ink); }
.sticker--paper { --st-bg: var(--paper); --st-fg: var(--paper-ink); }
.stamp {
  display: inline-block;
  padding: 6px 14px 4px;
  font-family: var(--f-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--stamp, var(--hot));
  border: 4px double var(--stamp, var(--hot));
  transform: rotate(var(--rot, -7deg));
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.7' numOctaves='2'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1 1 1 1 1 1 1 0 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.7' numOctaves='2'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1 1 1 1 1 1 1 0 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Symbole (Marker-Satz) ---------- */
.g {
  --plate: var(--tone, var(--ice));
  width: var(--gs, 22px);
  height: var(--gs, 22px);
  flex: none;
  overflow: visible;
  color: var(--bone);
}
.g .gp { fill: none; stroke: var(--plate); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; transform: translate(1.3px, 1.5px); }
.g .gi { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.g .gd { fill: currentColor; stroke: none; }

/* ---------- MarkerLine ---------- */
.mline { display: block; overflow: visible; }
.mline path { fill: none; stroke: var(--mtone, var(--gold)); stroke-width: 5; stroke-linecap: round; }

/* ---------- TagButton ---------- */
.tb {
  --tb-bg: var(--wall-hi);
  --tb-fg: var(--bone);
  position: relative;
  display: inline-flex;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: none;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.tb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translate(4px, 4px);
  z-index: -1;
}
.tb-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tb-fg);
  background: var(--tb-bg);
  border: 3px solid var(--ink);
  transition: transform var(--t-press) var(--ease-out);
  white-space: nowrap;
}
.tb:hover .tb-face { transform: translate(-2px, -2px); }
.tb:active .tb-face { transform: translate(3px, 3px); transition-duration: 40ms; }
.tb:focus-visible { outline: none; }
.tb:focus-visible .tb-face { outline: 3px dashed var(--acid); outline-offset: 4px; }
.tb--primary { --tb-bg: var(--gold); --tb-fg: var(--ink); }
.tb--ghost::before { display: none; }
.tb--ghost .tb-face { background: transparent; border-color: transparent; color: var(--smoke); }
.tb--ghost:hover .tb-face { color: var(--bone); transform: none; }
.tb--icon .tb-face { width: 44px; padding: 0; }
.tb.is-on .tb-face { background: var(--tone, var(--ice)); color: var(--ink); }
.tb--sm, .tb--sm .tb-face { min-height: 36px; }
.tb--sm .tb-face { font-size: 14px; padding: 0 11px; border-width: 2px; }
.tb--sm::before { transform: translate(3px, 3px); }

/* Segmente */
.seg { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* Schieberegler – Spur gezeichnet, Griff als Dosenkappe */
.slider { --pct: 50%; position: relative; height: 44px; display: flex; align-items: center; }
.slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; position: relative; z-index: 1; }
.slider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 10px;
  margin-top: -5px;
  background:
    linear-gradient(90deg, var(--tone, var(--ice)) var(--pct), transparent var(--pct)),
    repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 10px),
    var(--sunk);
  border: 2px solid var(--ink);
}
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 30px;
  background: var(--bone);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  border-radius: 4px 4px 9px 9px;
}
.slider input::-moz-range-thumb { width: 22px; height: 26px; background: var(--bone); border: 3px solid var(--ink); border-radius: 4px 4px 9px 9px; }
.slider input:focus-visible { outline: 3px dashed var(--acid); outline-offset: 2px; }

/* ---------- Bewegung (einmal je Anlass) ---------- */
@keyframes k-slap-in {
  from { opacity: 0; transform: translate(0, 22px) rotate(calc(var(--rot, 0deg) + 2.4deg)) scale(.95); }
  to { opacity: 1; transform: translate(0, 0) rotate(var(--rot, 0deg)) scale(1); }
}
@keyframes k-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes k-letter {
  0% { opacity: 0; transform: translateY(calc(var(--y, 0px) - 34px)) rotate(calc(var(--r, 0deg) - 14deg)) scale(1.5); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)) scale(1); }
}
@keyframes k-stamp {
  0% { opacity: 0; transform: rotate(calc(var(--rot, -7deg) - 10deg)) scale(1.9); }
  55% { opacity: 1; transform: rotate(var(--rot, -7deg)) scale(.92); }
  100% { opacity: 1; transform: rotate(var(--rot, -7deg)) scale(1); }
}
@keyframes k-draw { from { stroke-dashoffset: var(--len, 400); } to { stroke-dashoffset: 0; } }
@keyframes k-wipe {
  0% { transform: translateX(-112%) skewX(-12deg); }
  45% { transform: translateX(0) skewX(-12deg); }
  100% { transform: translateX(112%) skewX(-12deg); }
}
@keyframes k-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes k-kick { 0% { transform: rotate(var(--rot, 0deg)) scale(1); } 35% { transform: rotate(calc(var(--rot, 0deg) - 1.5deg)) scale(1.06); } 100% { transform: rotate(var(--rot, 0deg)) scale(1); } }

.in-slap { animation: k-slap-in var(--t-enter) var(--ease-pop) both; animation-delay: calc(var(--d, 0ms) + min(var(--i, 0), 10) * var(--t-stagger)); }
.in-up { animation: k-up var(--t-enter) var(--ease-out) both; animation-delay: calc(var(--d, 0ms) + min(var(--i, 0), 10) * var(--t-stagger)); }
.in-stamp { animation: k-stamp 520ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.piece.is-in .l { animation: k-letter 440ms var(--ease-pop) both; animation-delay: calc(var(--d, 0ms) + var(--li) * var(--t-letter)); }
.draw-in path { stroke-dasharray: var(--len, 400); animation: k-draw 520ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.kick { animation: k-kick 260ms var(--ease-out); }

.wipe {
  position: fixed;
  inset: -10% -20%;
  z-index: 100;
  pointer-events: none;
  background: var(--ink);
  transform: translateX(112%) skewX(-12deg);
  animation: k-wipe 700ms cubic-bezier(.7, 0, .2, 1) both;
}
.wipe::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 18px;
  background: var(--wipe-tone, var(--core));
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wipe { display: none; }
}

/* Variantenwahl (nur Entwurf) */
.variant-bar { display: inline-flex; gap: 6px; align-items: center; }
.variant-bar a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 10px;
  font: 700 13px/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; color: var(--smoke);
  border: 2px solid var(--line);
  background: var(--sunk);
}
.variant-bar a b { font: 900 15px/1 var(--f-display); color: var(--bone); }
.variant-bar a[aria-current='page'] { color: var(--night); background: var(--bone); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.variant-bar a[aria-current='page'] b { color: var(--night); }

/* ---------- Aufkleber-Zeichnungen (Die-Cut: Schatten → Papierrand → Zeichnung) ---------- */
.art { display: block; width: 100%; height: 100%; overflow: visible; }
.art .die-sh { transform: translate(3px, 3.5px); }
.art .die-sh * { fill: var(--ink) !important; stroke: var(--ink) !important; stroke-width: 13px !important; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: none !important; opacity: 1 !important; }
.art .die * { fill: var(--die, #f3eee3) !important; stroke: var(--die, #f3eee3) !important; stroke-width: 10px !important; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: none !important; opacity: 1 !important; }
.art .body * { stroke-linejoin: round; stroke-linecap: round; }
.art .body .p1 { fill: var(--sc); stroke: #07080d; stroke-width: 3; }
.art .body .p2 { fill: #f3eee3; stroke: #07080d; stroke-width: 3; }
.art .body .p3 { fill: #2b3243; stroke: #07080d; stroke-width: 3; }
.art .body .p4 { fill: var(--sc2); stroke: #07080d; stroke-width: 3; }
.art .body .ln { fill: none; stroke: #07080d; stroke-width: 3; }
.art .body .dash { stroke-dasharray: 5 6; }
.art .body .lo { fill: none; stroke: #07080d; stroke-width: 7.5; }
.art .body .lc { fill: none; stroke: var(--sc); stroke-width: 3.5; }
.art .body .l4 { fill: none; stroke: var(--sc2); stroke-width: 3.5; }
.art .body .lw { fill: none; stroke: #f3eee3; stroke-width: 3.5; }
.art .body .lz { fill: none; stroke: var(--laser); stroke-width: 3.5; }
.art .body .lz2 { fill: none; stroke: var(--laser); stroke-width: 2.5; opacity: .55; }
.art .body .gl { fill: none; stroke: #fff; stroke-width: 2.6; opacity: .7; }
.art .body .inkf { fill: #07080d; stroke: none; }
.art .body .tx { font: 800 13px/1 'Barlow Condensed', sans-serif; fill: #07080d; text-anchor: middle; stroke: none; }
[data-s='phy'] { --tone: var(--c-phy); --sc: var(--c-phy); --sc2: var(--core); }
[data-s='che'] { --tone: var(--c-che); --sc: var(--c-che); --sc2: var(--ice); }
[data-s='bio'] { --tone: var(--c-bio); --sc: var(--c-bio); --sc2: #ff8a3d; }
[data-s='mat'] { --tone: var(--c-mat); --sc: var(--c-mat); --sc2: var(--uv); }
[data-s='geo'] { --tone: var(--c-geo); --sc: var(--c-geo); --sc2: var(--c-bio); }
[data-s='his'] { --tone: var(--c-his); --sc: var(--c-his); --sc2: var(--c-geo); }
@keyframes k-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.shake-x { animation: k-shake 280ms var(--ease-out); }
