/* Schloss-Rätsel: ein Vorhängeschloss aus Messing mit Stahlbügel */
.sr-lock {
  --sr-brass-hi: #e3c16f;
  --sr-brass: #c39a3e;
  --sr-brass-lo: #8c6a24;
  --sr-steel: #a7adb4;
  --sr-steel-lo: #6f757c;
  --sr-engrave: #2e2210;
  --sr-ivory: #f6ecd2;
  --sr-ok: #2f8f4e;
  --sr-bad: #b3261e;
  max-width: 440px;
  margin: 2em auto;
}
.sr-lock *, .sr-lock *::before, .sr-lock *::after { box-sizing: border-box; }
.sr-task { margin-bottom: 1.25em; }

.sr-padlock { position: relative; padding-top: 78px; }
.sr-shackle {
  position: absolute; top: 0; left: 50%;
  width: 170px; height: 128px; margin-left: -85px;
  border: 22px solid var(--sr-steel);
  border-bottom: 0;
  border-radius: 85px 85px 0 0;
  box-shadow: inset 0 4px 0 rgba(255,255,255,.35), 0 2px 0 var(--sr-steel-lo);
  transition: transform .55s cubic-bezier(.34,1.56,.64,1);
}
.sr-unlocked .sr-shackle { transform: translateY(-34px); }

.sr-body {
  position: relative; z-index: 1;
  padding: 30px 22px 18px;
  border-radius: 26px 26px 34px 34px;
  background:
    radial-gradient(120% 70% at 30% 0%, rgba(255,255,255,.28), transparent 60%),
    linear-gradient(170deg, var(--sr-brass-hi), var(--sr-brass) 45%, var(--sr-brass-lo));
  box-shadow: 0 14px 28px rgba(60,40,0,.28), inset 0 2px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(0,0,0,.18);
  color: var(--sr-engrave);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sr-unlocked .sr-ui, .sr-unlocked .sr-open { display: none; }

/* Rädchen */
.sr-wheels { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sr-wheel {
  display: flex; flex-direction: column; align-items: center;
  min-width: 44px; padding: 2px 0;
  background: linear-gradient(#1d150a, #3a2b14 50%, #1d150a);
  border-radius: 8px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.6);
}
.sr-wheel:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sr-val {
  font: 700 30px/1.15 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-variant-numeric: tabular-nums;
  color: var(--sr-ivory);
  min-width: 1.2em; text-align: center;
}
.sr-step {
  background: none; border: 0; padding: 4px 12px;
  color: var(--sr-brass-hi); font-size: 14px; cursor: pointer; line-height: 1;
}
.sr-step:hover { color: #fff; }

/* Farben */
.sr-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sr-slot {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid var(--sr-engrave);
  background: #6b5b3a; color: var(--sr-ivory);
  font-weight: 700; font-size: 18px; cursor: pointer;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.35);
}

/* Richtungen */
.sr-seq {
  min-height: 2.2em; margin-bottom: 12px; padding: 6px 10px;
  border-radius: 8px; background: rgba(46,34,16,.85);
  color: var(--sr-ivory); font-size: 22px; letter-spacing: .15em;
  text-align: center; word-break: break-all;
}
.sr-dpad {
  display: grid; justify-content: center; gap: 6px;
  grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px);
}
.sr-dir {
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--sr-engrave); color: var(--sr-ivory); font-size: 26px;
  box-shadow: 0 3px 0 #000;
}
.sr-dir:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.sr-dir-oben { grid-area: 1 / 2; }
.sr-dir-links { grid-area: 2 / 1; }
.sr-dir-rechts { grid-area: 2 / 3; }
.sr-dir-unten { grid-area: 3 / 2; }

/* Muster */
.sr-pattern {
  position: relative; width: 228px; height: 228px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  border-radius: 16px; background: rgba(46,34,16,.85);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.sr-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sr-lines polyline { fill: none; stroke: var(--sr-brass-hi); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.sr-dot {
  place-self: center; position: relative; z-index: 1;
  width: 30px; height: 30px; padding: 0; border-radius: 50%;
  border: 4px solid var(--sr-steel); background: transparent; cursor: pointer;
}
.sr-dot.on { background: var(--sr-brass-hi); border-color: var(--sr-brass-hi); }

/* Schalter */
.sr-switches { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sr-switch {
  position: relative; width: 38px; height: 68px; padding: 0; border: 0; border-radius: 19px;
  background: var(--sr-engrave); cursor: pointer;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.5);
}
.sr-switch::after {
  content: ""; position: absolute; left: 5px; bottom: 5px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--sr-steel); transition: bottom .18s ease;
}
.sr-switch.on { background: var(--sr-ok); }
.sr-switch.on::after { bottom: 35px; background: #fff; }

/* Passwort */
.sr-text {
  width: 100%; padding: 12px 14px; border: 0; border-radius: 10px;
  background: rgba(46,34,16,.9); color: var(--sr-ivory);
  font-size: 19px; text-align: center; letter-spacing: .05em;
}
.sr-text::placeholder { color: rgba(246,236,210,.5); }

/* Bedienung */
.sr-row { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.sr-mini {
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 2px solid var(--sr-engrave); color: var(--sr-engrave);
  font-size: 13px; font-weight: 600;
}
.sr-hint { margin: 10px 0 0; text-align: center; font-size: 13px; }
.sr-open {
  display: block; width: 100%; margin-top: 20px; padding: 13px;
  border: 0; border-radius: 14px; cursor: pointer;
  background: var(--sr-engrave); color: var(--sr-ivory);
  font-size: 17px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 4px 0 #000;
}
.sr-open:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.sr-open:disabled { opacity: .6; cursor: wait; }
.sr-lock button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sr-msg { min-height: 1.4em; margin: 12px 0 0; text-align: center; font-size: 15px; font-weight: 600; }
.sr-msg.bad { color: var(--sr-bad); }
.sr-msg.ok { color: #14532d; font-size: 20px; }

.sr-reveal {
  margin-top: 1.5em; padding: 1.2em 1.4em;
  border-left: 5px solid var(--sr-ok); border-radius: 6px;
  background: rgba(47,143,78,.08);
}

.sr-shake { animation: sr-shake .4s; }
@keyframes sr-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .sr-shackle, .sr-switch::after { transition: none; }
  .sr-shake { animation: none; }
}
@media (max-width: 380px) {
  .sr-body { padding: 26px 14px 16px; }
  .sr-val { font-size: 26px; }
  .sr-wheel { min-width: 38px; }
}
