/* ============================================================
   DACKELLABOR — shared stylesheet
   Zine / lab-notebook look: paper, ink borders, hard shadows
   ============================================================ */

:root {
  --paper: #f6f1e4;
  --card: #fffcf3;
  --ink: #2e2418;
  --ink-soft: #6b5c47;
  --line: #e3d9c2;
  --amber: #e3a72f;
  --amber-soft: #f3d48a;
  --rust: #c05b2e;
  --teal: #3e8380;
  --pink: #d96a8b;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--amber); color: var(--ink); }

img, svg { display: block; }

a { color: var(--rust); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.2rem;
  background: var(--card);
  border-bottom: 2px solid var(--ink);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.logo-dog svg { height: 30px; width: auto; }
.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}
.logo-text em {
  font-style: normal;
  color: var(--rust);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.topnav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 1px;
}
.topnav a:hover { background: var(--amber-soft); }

.exp-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--paper);
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
}
.exp-badge.amber { background: var(--amber); color: var(--ink); }

/* ---------- layout ---------- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.2rem 4rem;
}

.page-head { margin-bottom: 2rem; position: relative; }
.page-head .exp-badge { margin-bottom: 0.8rem; }

h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h1 .accent { color: var(--rust); font-style: italic; }

.lede {
  margin-top: 0.9rem;
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 56ch;
  line-height: 1.6;
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

/* squiggle underline for h1 on subpages */
.squiggle {
  display: block;
  margin-top: 0.6rem;
  width: 180px;
  height: 10px;
}

/* ---------- panels & cards ---------- */
.panel {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 2rem 1.6rem;
  margin-top: 1.6rem;
  animation: rise 0.45s ease both;
}

.panel + .panel { animation-delay: 0.08s; }

.panel-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- home two-column layout ---------- */
.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  align-items: start;
  margin-top: 1.8rem;
}
.home-layout .exp-grid,
.home-layout .panel { margin-top: 0; }
@media (min-width: 880px) {
  main.wide { max-width: 1240px; padding-top: 1.2rem; padding-bottom: 2rem; }
  main.wide .page-head { margin-bottom: 1rem; }
  main.wide h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
  main.wide h1 br { display: none; }
  main.wide .lede { font-size: 0.98rem; margin-top: 0.5rem; max-width: 74ch; }
  main.wide .conveyor { margin-top: 0.8rem; height: 100px; }
  main.wide .conveyor .walker { transform: scale(0.7); transform-origin: bottom left; }
  main.wide .conveyor .walker.w2 { transform: scale(0.52); }
  main.wide .conveyor .walker.w3 { transform: scale(0.4); }
  main.wide .exp-card p {
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  main.wide .conveyor { margin-top: 2rem; }
  main.wide .exp-grid { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
  main.wide .exp-card { padding: 1rem 1.1rem 0.9rem; }
  .home-layout { grid-template-columns: 1.65fr 1fr; }
  .home-layout .side-col { position: sticky; top: 74px; }
}

/* ---------- experiment grid (home) ---------- */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.4rem;
  margin-top: 1.8rem;
}

.exp-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 1.3rem 1.2rem 1.1rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: rise 0.45s ease both;
}
.exp-grid .exp-card:nth-child(odd)  { transform: rotate(-0.5deg); }
.exp-grid .exp-card:nth-child(even) { transform: rotate(0.4deg); }
.exp-grid .exp-card:nth-child(2) { animation-delay: 0.05s; }
.exp-grid .exp-card:nth-child(3) { animation-delay: 0.1s; }
.exp-grid .exp-card:nth-child(4) { animation-delay: 0.15s; }
.exp-grid .exp-card:nth-child(5) { animation-delay: 0.2s; }
.exp-grid .exp-card:nth-child(6) { animation-delay: 0.25s; }

.exp-card:hover {
  transform: rotate(0deg) translate(-2px, -3px);
  box-shadow: 8px 9px 0 var(--ink);
}

.exp-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0.6rem 0 0.35rem;
}
.exp-card p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
  min-height: 2.7em;
}
.exp-card .go {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 2px solid var(--amber);
}
.exp-card .done-mark {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  transform: rotate(4deg);
}

/* ---------- birthday stamp ---------- */
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--pink);
  border: 2.5px solid var(--pink);
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  transform: rotate(-3deg);
  background: rgba(217, 106, 139, 0.07);
  animation: stampIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}
@keyframes stampIn {
  from { opacity: 0; transform: rotate(-14deg) scale(2.2); }
  to   { opacity: 1; transform: rotate(-3deg) scale(1); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--amber-soft); }
.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}
.btn.primary { background: var(--amber); }
.btn.primary:hover { background: #eeb84a; }
.btn.big { font-size: 1.15rem; padding: 0.9rem 2rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.4rem;
}

/* ---------- meter (progress bar) ---------- */
.meter {
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  position: relative;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg, var(--amber), var(--amber) 10px, #eeb84a 10px, #eeb84a 20px
  );
  transition: width 0.25s ease;
}
.meter-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ---------- stat readouts ---------- */
.readout {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  text-align: center;
}
.readout strong { color: var(--ink); font-size: 1.25rem; }

.proto-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.proto-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1.5px dashed var(--line);
}
.proto-table td:last-child { text-align: right; font-weight: 600; }
.proto-table tr:last-child td { border-bottom: none; }

/* ---------- dog stage ---------- */
.stage {
  text-align: center;
  padding: 1rem 0;
}
.stage .dog-holder {
  display: inline-block;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stage .dog-holder:active { transform: scale(0.97); }

/* speech bubble */
.speech {
  position: absolute;
  top: -50px;
  left: 55%;
  transform: translateX(-50%) scale(0);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.35rem 0.9rem;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
  box-shadow: 3px 3px 0 var(--ink);
}
.speech.show { transform: translateX(-50%) scale(1); }
.speech::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}

/* floating hearts */
.heart {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  animation: heartFloat 1.3s ease-out forwards;
}
.heart svg { width: 26px; height: 26px; }
@keyframes heartFloat {
  0%   { transform: translateY(0) scale(0.5) rotate(0); opacity: 1; }
  100% { transform: translateY(-120px) scale(1.3) rotate(18deg); opacity: 0; }
}

/* ---------- dachshund animations ---------- */
.tail { animation: wag 0.8s ease-in-out infinite; }
.happy .tail { animation-duration: 0.16s; }
@keyframes wag {
  0%, 100% { transform: rotate(-14deg); }
  50%      { transform: rotate(26deg); }
}
.ear { animation: earFlop 3.4s ease-in-out infinite; }
@keyframes earFlop {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(7deg); }
}
.walking .legF1, .walking .legB1 { animation: step 0.38s ease-in-out infinite; }
.walking .legF2, .walking .legB2 { animation: step 0.38s ease-in-out infinite reverse; }
.leg { transform-origin: top center; transform-box: fill-box; }
@keyframes step {
  0%, 100% { transform: rotate(18deg); }
  50%      { transform: rotate(-18deg); }
}

/* ---------- conveyor (home marquee) ---------- */
.conveyor {
  position: relative;
  height: 130px;
  margin-top: 2.2rem;
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
  background-image: repeating-linear-gradient(
    90deg, var(--ink) 0, var(--ink) 2px, transparent 2px, transparent 40px
  );
  background-size: 40px 8px;
  background-position: bottom;
  background-repeat: repeat-x;
}
.conveyor .walker {
  position: absolute;
  bottom: 4px;
  left: -280px;
  animation: walkAcross 16s linear infinite;
}
.conveyor .walker.w2 { animation-delay: 5.5s; transform: scale(0.72); transform-origin: bottom left; }
.conveyor .walker.w3 { animation-delay: 11s; transform: scale(0.55); transform-origin: bottom left; }
@keyframes walkAcross {
  from { left: -280px; }
  to   { left: 105%; }
}

/* ---------- candles / cake ---------- */
.cake-wrap { display: inline-block; position: relative; margin-top: 4.2rem; }
.candle {
  position: absolute;
  width: 13px;
  height: 42px;
  background: repeating-linear-gradient(45deg, var(--rust), var(--rust) 5px, var(--card) 5px, var(--card) 10px);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.12s;
  transform: translateX(-50%);
  z-index: 2;
}
.candle:hover { transform: translateX(-50%) scale(1.18); }
.flame {
  position: absolute;
  top: -17px;
  left: 50%;
  width: 11px;
  height: 15px;
  background: radial-gradient(circle at 50% 72%, var(--amber), #e07b1f);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  animation: flicker 0.32s ease-in-out infinite alternate;
}
@keyframes flicker {
  from { transform: translateX(-50%) scale(1) rotate(-4deg); }
  to   { transform: translateX(-50%) scale(1.22) rotate(4deg); }
}
.candle.out .flame { display: none; }
.candle.out::after {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
  opacity: 0.7;
  animation: smokeUp 0.9s ease-out forwards;
}
@keyframes smokeUp {
  to { transform: translateY(-22px) scale(1.6); opacity: 0; }
}

.cake-body { width: 320px; max-width: 80vw; margin: 0 auto; position: relative; }
.cake-layer { border-radius: 12px; margin: 0 auto; position: relative; border: 2px solid var(--ink); }
.layer1 { width: 64%; height: 52px; background: #e8b4c2; }
.layer2 { width: 84%; height: 58px; background: #f0dcb8; margin-top: -8px; }
.layer3 { width: 100%; height: 62px; background: #9a6b3f; margin-top: -8px; }
.cake-layer::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px;
  height: 16px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 12px 12px 45% 45%;
}
.plate {
  width: 112%;
  height: 14px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 50%;
  margin: -3px auto 0;
  position: relative;
  left: -6%;
}

/* ---------- ruler (stretch page) ---------- */
.ruler-stage {
  overflow-x: auto;
  padding: 1.2rem 0 0;
}
.ruler {
  height: 26px;
  border-top: 2.5px solid var(--ink);
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink) 0, var(--ink) 1.5px, transparent 1.5px, transparent 20px
  );
  background-size: 20px 10px;
  background-repeat: repeat-x;
  min-width: 100%;
}

/* ---------- catch game ---------- */
.game-frame {
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  background: linear-gradient(180deg, #eaf2ee 0%, var(--card) 100%);
  position: relative;
  touch-action: none;
}
.game-frame canvas { display: block; width: 100%; }
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(246, 241, 228, 0.88);
  text-align: center;
  padding: 1rem;
}
.game-overlay.hidden { display: none; }
.game-overlay h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
}
.game-hud {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

/* ---------- sprint page ---------- */
.track {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  padding: 0.4rem 0;
  margin-top: 0.6rem;
  overflow: hidden;
}
.lane {
  position: relative;
  height: 96px;
  border-bottom: 2px dashed var(--line);
}
.lane:last-child { border-bottom: none; }
.lane .runner {
  position: absolute;
  bottom: 2px;
  left: 0;
  will-change: transform;
}
.lane .lane-name {
  position: absolute;
  top: 6px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  z-index: 2;
}
.finish {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 26px;
  width: 12px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, var(--card) 0% 50%);
  background-size: 12px 12px;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 4.5rem;
  background: rgba(246, 241, 228, 0.82);
  z-index: 5;
}
.countdown.hidden { display: none; }

/* ---------- konfigurator ---------- */
.config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
}
@media (min-width: 680px) {
  .config-grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.5rem 0 1.2rem;
}
.swatch {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 2px 2px 0 var(--ink);
}
.swatch:hover { transform: scale(1.1); }
.swatch.active {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.5rem 0 1.2rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.chip.active { background: var(--amber); }
.text-input {
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  background: var(--card);
  width: 100%;
  max-width: 260px;
  box-shadow: 2px 2px 0 var(--ink);
}
.text-input:focus { outline: 3px solid var(--amber-soft); }
.config-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.preview-box {
  border: 2px dashed var(--ink-soft);
  border-radius: 10px;
  padding: 1.5rem 0.5rem;
  text-align: center;
  background: var(--paper);
  overflow-x: auto;
}
.mascot-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin-top: 0.6rem;
}

/* ---------- sound toggle ---------- */
.sound-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}
.sound-btn:hover { background: var(--amber-soft); }

/* ---------- security gate (first visit) ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(246, 241, 228, 0.94);
  display: flex;
  justify-content: center;
  padding: 1.2rem;
  overflow-y: auto;
}
.gate-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 2.2rem 1.8rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: rise 0.4s ease both;
  margin: auto;
  transition: max-width 0.3s ease;
}
.gate-card.wide { max-width: 780px; text-align: left; }
.gate-card h2 { margin-top: 0.8rem; }
.gate-card p { color: var(--ink-soft); line-height: 1.6; margin: 0.6rem 0 1.4rem; }

/* ---------- Butterbrot (Akte B) ---------- */
.brot {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.4, 0.9, 0.5, 1), opacity 0.18s 0.45s;
}
.brot svg { width: 40px; height: 34px; }

.dossier-table td:first-child { color: var(--ink-soft); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 120px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  z-index: 500;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- confetti canvas ---------- */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* ---------- footer ---------- */
.labfoot {
  border-top: 2px solid var(--ink);
  background: var(--card);
  padding: 1.6rem 1.2rem 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.9;
}

/* ---------- helpers ---------- */
.center { text-align: center; }
.mt1 { margin-top: 1rem; }
.mt2 { margin-top: 2rem; }
.hidden { display: none !important; }

.next-exp {
  margin-top: 2.2rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ---------- mobile ---------- */
.btn, .chip, .swatch, .candle, .dog-holder, .exp-card, .sound-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 640px) {
  /* kompakte Kopfzeile in einer Zeile */
  .topbar { padding: 0.55rem 0.8rem; gap: 0.6rem; }
  .logo { gap: 0.4rem; }
  .logo-dog svg { height: 24px; }
  .logo-text { font-size: 1rem; }
  .topnav { gap: 0.55rem; font-size: 0.7rem; white-space: nowrap; }
  .topnav .exp-badge { display: none; }
  .sound-btn { font-size: 0.65rem; padding: 0.22rem 0.45rem; }

  /* mehr nutzbare Breite */
  main { padding: 1.6rem 1rem 3rem; }
  .panel { padding: 1.4rem 1rem; border-radius: 8px; box-shadow: var(--shadow-sm); }
  .page-head { margin-bottom: 1.4rem; }
  .lede { font-size: 0.98rem; }
  .stamp { font-size: 0.7rem; padding: 0.4rem 0.7rem; }

  /* Buttons: volle Breite, gut fürs Daumen-Tippen */
  .btn-row { gap: 0.6rem; }
  .btn-row .btn { flex: 1 1 auto; }
  .btn.big { width: 100%; font-size: 1.05rem; padding: 0.85rem 1rem; }

  /* Karten */
  .exp-card p { min-height: 0; }
  .exp-grid { gap: 1rem; }

  /* Spiele-HUD darf umbrechen */
  .game-hud { flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.75rem; }

  /* Kerzen: größere Tippfläche */
  .candle { width: 17px; height: 50px; }

  /* Sprint: Bahnen etwas flacher, Läufer kleiner */
  .lane { height: 84px; }
  .lane .runner svg { height: 72px; }
  .finish { right: 14px; }
  .countdown { font-size: 3.2rem; }

  /* Sprechblase & Tabellen */
  .speech { font-size: 0.95rem; top: -44px; }
  .proto-table { font-size: 0.78rem; }
  .readout { font-size: 0.85rem; }
  .readout strong { font-size: 1.1rem; }

  /* Onboarding-Overlay */
  .gate { padding: 0.8rem; }
  .gate-card { padding: 1.5rem 1.1rem; }
  .preview-box { padding: 1rem 0.4rem; }
  .swatch { width: 46px; height: 46px; }
  .text-input { max-width: none; }

  /* Konfetti-Feuerwerk gibt es, Hover-Rotation nicht */
  .exp-grid .exp-card:nth-child(odd),
  .exp-grid .exp-card:nth-child(even) { transform: none; }

  .next-exp { text-align: center; }
  .conveyor { height: 100px; }
  .conveyor .walker { transform: scale(0.7); transform-origin: bottom left; }
  .conveyor .walker.w2 { transform: scale(0.5); }
  .conveyor .walker.w3 { transform: scale(0.38); }
}

/* sehr schmale Geräte */
@media (max-width: 380px) {
  .logo-text { font-size: 0.9rem; }
  .topnav a { border-bottom-width: 1.5px; }
  h1 { font-size: 1.7rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
