.memory{margin:28px 12px;padding:24px 12px;background:rgba(255,255,255,.5);backdrop-filter:blur(1.5px);-webkit-backdrop-filter:blur(1.5px);border:1px solid #d8e5ef;border-radius:16px;text-align:center;scroll-margin-top:12px}
.memory-eyebrow{font-size:.8rem;font-weight:800;letter-spacing:.08em;color:#164f8b;text-transform:uppercase}
.memory h1{font-size:clamp(1.5rem,4vw,2.2rem);margin:10px 0;color:#123f77}
.memory p{line-height:1.5}
.memory-controls{display:flex;flex-wrap:wrap;align-items:end;justify-content:center;gap:12px;margin:22px 0}
.memory-controls label{display:grid;gap:6px;text-align:left;font-weight:700}
.memory button,.memory select{font:inherit;min-height:44px;touch-action:manipulation}
.memory select{max-width:100%;padding:10px;border:1px solid #a6bfd5;border-radius:9px;color:#173b64;background:white}
.memory-controls button,.memory-result button{border:0;border-radius:999px;padding:12px 22px;background:#164f8b;color:white;font-weight:700;cursor:pointer}
.memory button:focus-visible,.memory select:focus-visible,.memory a:focus-visible{outline:3px solid #e21f2f;outline-offset:3px}
.memory-stats{display:flex;justify-content:center;gap:8px}
.memory-stats span{flex:1;max-width:160px;border-radius:10px;background:white;padding:10px 4px;font-size:.85rem}
.memory-stats strong{display:block;font-size:1.4rem;margin-top:4px;font-variant-numeric:tabular-nums}
#memory-status{min-height:3em;margin:14px 0 8px}
.memory-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-width:850px;margin:auto}
.memory-tile{position:relative;aspect-ratio:3/4;padding:0;border:3px solid white;border-radius:10px;background:white;box-shadow:0 3px 9px #173b6424;cursor:pointer;overflow:hidden;-webkit-tap-highlight-color:transparent}
.memory-tile img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.memory-tile .memory-front{display:none}
.memory-tile.is-open .memory-front{display:block}
.memory-tile.is-open .memory-back{display:none}
.memory-tile.is-matched{border-color:#25844b;cursor:default}
.memory-tile.is-matched:after{content:'\2713';position:absolute;right:0;top:0;background:#25844b;color:white;padding:2px 5px;border-radius:0 0 0 7px;font-weight:900}
.memory-tile:disabled{opacity:1}
.memory-result{margin:22px auto 0;max-width:600px;background:#fff4c8;border:2px solid #f5bd16;border-radius:12px;padding:20px}
.memory-result[hidden]{display:none}
.memory-result h2{margin-top:0}
.memory-rules-link{display:inline-block;margin-top:22px;color:#164f8b;font-weight:700;padding:10px}
@media(min-width:380px){.memory-board{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:700px){.memory{margin:30px 28px;padding:28px}.memory-board{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

.memory-controls label{max-width:100%;min-width:0}
.memory-tile{aspect-ratio:1}
@media(min-width:1000px){.memory-board{grid-template-columns:repeat(6,minmax(0,1fr))}}

.memory-board.memory-board-split{display:grid;grid-template-columns:minmax(0,1fr);max-width:100%;gap:24px}
.memory-field{min-width:0;border:1px solid #c7dcec;border-radius:12px;background:#fff;padding:10px}
.memory-field h2{margin:0 0 12px;color:#164f8b;font-size:1.15rem;text-align:left}
.memory-field-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.memory-field:nth-child(2){background:#fffbeb;border-color:#ead898}
@media(min-width:380px){.memory-field-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:850px){.memory-board.memory-board-split{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.memory-field-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

.memory-controls .memory-practice-control{display:flex;align-items:center;gap:8px;min-height:44px;max-width:280px;font-size:.95rem}
.memory-controls .memory-practice-control[hidden]{display:none}
.memory-practice-control input{width:20px;height:20px;accent-color:#164f8b;flex-shrink:0}
.memory-practice-control input:focus-visible{outline:3px solid #e21f2f;outline-offset:3px}
.memory-tile.is-selected{border-color:#164f8b;box-shadow:0 0 0 2px #164f8b}

#memory-practice-control[hidden]{display:none}

.memory-round{margin:0 auto 22px;padding:20px 14px;max-width:850px;background:rgba(255,255,255,.5);border:1px solid #c7dcec;border-top:4px solid #f5bd16;border-radius:14px}
.memory-round .memory-round-eyebrow{margin:0 0 6px;text-transform:uppercase;letter-spacing:.12em;font-size:.75rem;font-weight:800;color:#164f8b}
.memory-round h2{font-size:clamp(1.7rem,5vw,2.6rem);line-height:1.15;margin:0 0 10px;color:#123f77;text-transform:uppercase;overflow-wrap:anywhere}
#memory-round-details{margin:0;font-weight:800;font-size:1.05rem}
#memory-round-mode{display:inline-block;margin:10px 0 0;padding:6px 12px;border-radius:99px;background:#164f8b;color:white;font-weight:700;font-size:.9rem}
.memory-round #memory-description{margin:12px 0 0;color:#334d66}

/* Abschlussfenster – SKTC-Fastnachtsdesign */
.memory-result{position:fixed;inset:0;z-index:9000;margin:0!important;max-width:none!important;padding:20px!important;background:rgba(5,28,52,.70)!important;border:0!important;border-radius:0!important;display:grid;place-items:center;overflow:auto;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.memory-result[hidden]{display:none!important}
.memory-result-card{position:relative;width:min(620px,94vw);margin:95px auto 25px;padding:100px 28px 28px;text-align:center;color:#173b64;background:linear-gradient(180deg,#fffef8 0%,#fff8df 100%);border:4px solid #f2c431;border-radius:30px;box-shadow:0 24px 70px rgba(0,0,0,.38),inset 0 0 0 4px rgba(255,255,255,.75)}
.memory-result-hat{position:absolute;z-index:2;top:-115px;left:50%;transform:translateX(-50%);width:min(380px,78vw);height:auto;filter:drop-shadow(0 10px 10px rgba(0,0,0,.20))}
.memory-result h2{position:relative;margin:0 0 12px;font-size:clamp(3rem,9vw,5.7rem);line-height:.82;letter-spacing:-.045em;font-weight:900;text-shadow:0 4px 0 #fff,0 7px 0 #f2c431,0 10px 14px rgba(0,0,0,.20)}
.memory-result h2 span,.memory-result h2 strong{display:block}
.memory-result h2 span{color:#d71920}.memory-result h2 strong{color:#164f8b}
.memory-result-ribbon{position:relative;margin:20px -42px 18px;padding:11px 38px;background:linear-gradient(#e52b32,#bd0f1a);color:#fff;font-size:clamp(1.1rem,3vw,1.55rem);font-weight:900;font-style:italic;box-shadow:0 5px 10px rgba(0,0,0,.18)}
.memory-result-ribbon:before,.memory-result-ribbon:after{content:"";position:absolute;top:100%;border-style:solid}.memory-result-ribbon:before{left:0;border-width:0 14px 13px 0;border-color:transparent #7f0c13 transparent transparent}.memory-result-ribbon:after{right:0;border-width:13px 14px 0 0;border-color:#7f0c13 transparent transparent transparent}
.memory-result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:0;margin:0 auto 18px;padding:13px 8px;background:#fff;border:1px solid #e8d9b5;border-radius:16px;box-shadow:0 5px 12px rgba(0,0,0,.08)}
.memory-result-stats span{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-items:center;padding:2px 14px;font-size:1.65rem}.memory-result-stats span+span{border-left:1px solid #e3d7bd}.memory-result-stats small{font-size:.8rem;font-weight:800}.memory-result-stats strong{font-size:1.3rem}
.memory-result-message{margin:12px 0 20px!important;font-size:1.25rem;font-weight:900;font-style:italic}.memory-result-message span{font-size:1rem;font-weight:700}
.memory-result #memory-again{min-width:min(330px,90%);padding:14px 26px;background:linear-gradient(#ffd438,#f4b713);color:#123c6a;border:2px solid #e4a800;border-radius:14px;font-size:1.2rem;font-weight:900;box-shadow:0 5px 10px rgba(0,0,0,.15)}
.memory-result #memory-again:hover{transform:translateY(-1px);filter:brightness(1.04)}
.memory-result #memory-again:focus-visible{outline:4px solid #164f8b;outline-offset:3px}
@media(max-width:600px){.memory-result{padding:12px!important}.memory-result-card{margin-top:70px;padding:76px 15px 20px;border-radius:22px}.memory-result-hat{top:-82px;width:min(285px,75vw)}.memory-result-ribbon{margin:16px -25px 14px;padding:9px 22px}.memory-result-stats{padding:9px 4px}.memory-result-stats span{padding:2px 5px;font-size:1.2rem}.memory-result-stats strong{font-size:1.05rem}.memory-result-message{font-size:1.05rem}.memory-result h2{font-size:clamp(2.8rem,16vw,4.7rem)}}
@media(prefers-reduced-motion:reduce){.memory-result #memory-again:hover{transform:none}}

/* Abschlussfenster – kompakter, mobilfreundlicher und ohne teuren Hintergrund-Blur */
.memory-result{
  padding:14px!important;
  background:rgba(5,28,52,.72)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.memory-result-card{
  width:min(560px,calc(100vw - 28px));
  margin:82px auto 18px;
  padding:88px 22px 24px;
  overflow:visible;
}
.memory-result-hat{
  z-index:1;
  top:-104px;
  width:min(350px,72vw);
}
.memory-result h2{
  z-index:3;
  margin:-10px 0 10px;
  font-family:"Brush Script MT","Segoe Script","URW Chancery L",cursive;
  font-size:clamp(3.1rem,9vw,5.2rem);
  line-height:.78;
  letter-spacing:-.02em;
  font-weight:700;
  transform:rotate(-2deg);
}
.memory-result h2 span,.memory-result h2 strong{position:relative;z-index:3}
.memory-result-ribbon{
  z-index:4;
  margin:18px -30px 18px;
  padding:12px 32px 14px;
  border-radius:50% 50% 18px 18px / 22% 22% 45% 45%;
  transform:rotate(-1deg);
}
.memory-result-ribbon:before{left:3px}
.memory-result-ribbon:after{right:3px}
.memory-result-stats{
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  text-align:center;
}
.memory-result-stats span{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:2px;
  padding:4px 8px;
  text-align:center;
}
.memory-result-stats small,.memory-result-stats strong{display:block;text-align:center}
.memory-result-message span{display:inline-block;margin-top:3px}

@media(max-width:480px){
  .memory-result{padding:8px!important;align-items:center}
  .memory-result-card{
    width:calc(100vw - 16px);
    margin:58px auto 8px;
    padding:66px 10px 15px;
    border-width:3px;
    border-radius:18px;
  }
  .memory-result-hat{top:-68px;width:min(245px,66vw)}
  .memory-result h2{margin:-4px 0 8px;font-size:clamp(2.65rem,14vw,3.8rem);line-height:.78}
  .memory-result-ribbon{margin:12px -15px 12px;padding:9px 16px 11px;font-size:1rem}
  .memory-result-stats{margin-bottom:12px;padding:7px 2px;border-radius:12px}
  .memory-result-stats span{padding:2px 3px;font-size:1.05rem}
  .memory-result-stats small{font-size:.7rem}.memory-result-stats strong{font-size:.95rem}
  .memory-result-message{margin:8px 0 13px!important;font-size:.98rem;line-height:1.25}
  .memory-result-message span{font-size:.88rem}
  .memory-result #memory-again{min-width:0;width:min(280px,92%);padding:11px 16px;font-size:1rem}
}


/* Erfolgsmeldung mit fertiger Helau-Grafik – responsive */
.memory-result{
  box-sizing:border-box;
  padding:16px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  background:rgba(5,28,52,.72)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.memory-result-card{
  box-sizing:border-box;
  width:min(540px,calc(100vw - 32px))!important;
  max-width:540px!important;
  margin:auto!important;
  padding:18px 20px 22px!important;
  overflow:hidden!important;
  text-align:center;
  border-radius:24px;
}
.memory-result-sr-title{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.memory-result-graphic{
  display:block!important;
  width:94%!important;
  max-width:490px!important;
  height:auto!important;
  max-height:none!important;
  margin:0 auto 10px!important;
  object-fit:contain!important;
}
.memory-result-hat,.memory-result-ribbon{display:none!important}
.memory-result-stats{
  width:100%;
  box-sizing:border-box;
  margin:0 auto 14px!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  text-align:center;
}
.memory-result-stats span{
  min-width:0;
  padding:4px 6px!important;
  align-items:center!important;
  text-align:center!important;
}
.memory-result-stats small,.memory-result-stats strong{display:block;text-align:center}
.memory-result-message{margin:10px 0 16px!important}

@media(max-width:480px){
  .memory-result{padding:8px!important}
  .memory-result-card{
    width:calc(100vw - 16px)!important;
    max-width:calc(100vw - 16px)!important;
    padding:10px 8px 14px!important;
    border-width:3px;
    border-radius:18px;
  }
  .memory-result-graphic{
    width:92%!important;
    max-width:100%!important;
    margin:0 auto 6px!important;
  }
  .memory-result-stats{margin-bottom:10px!important;padding:7px 2px!important}
  .memory-result-stats span{padding:2px!important;font-size:1rem!important}
  .memory-result-stats small{font-size:.68rem!important}
  .memory-result-stats strong{font-size:.92rem!important}
  .memory-result-message{font-size:.96rem!important;line-height:1.22}
  .memory-result-message span{font-size:.84rem!important}
  .memory-result #memory-again{width:min(260px,92%);min-width:0;padding:10px 14px;font-size:1rem}
}

@media(max-width:360px){
  .memory-result-graphic{width:88%!important}
  .memory-result-card{padding:8px 6px 12px!important}
  .memory-result-stats strong{font-size:.86rem!important}
  .memory-result-message{font-size:.9rem!important}
  .memory-result-message span{font-size:.79rem!important}
}


/* Feinschliff Erfolgsmeldung: schmale Mobilgeraete */
.memory-result-card{max-width:calc(100vw - 16px)!important;}
.memory-result-message{box-sizing:border-box;max-width:100%;padding-inline:8px;overflow-wrap:anywhere;word-break:normal;}
.memory-result-message span{display:inline;max-width:100%;white-space:normal;}
@media(max-width:480px){
  .memory-result-card{width:calc(100vw - 12px)!important;max-width:calc(100vw - 12px)!important;padding:9px 6px 13px!important;}
  .memory-result-message{width:100%;padding-inline:4px;font-size:.9rem!important;line-height:1.25;}
  .memory-result-message span{font-size:.8rem!important;}
  .memory-result-stats strong{font-size:.86rem!important;}
}
@media(max-width:360px){
  .memory-result{padding:4px!important;}
  .memory-result-card{width:calc(100vw - 8px)!important;max-width:calc(100vw - 8px)!important;padding:7px 4px 11px!important;border-radius:15px;}
  .memory-result-graphic{width:84%!important;}
  .memory-result-stats small{font-size:.62rem!important;}
  .memory-result-stats strong{font-size:.78rem!important;}
  .memory-result-message{padding-inline:2px;font-size:.84rem!important;}
  .memory-result-message span{font-size:.74rem!important;}
}

/* Ergebnisfenster: echte Kleinformat-Ansicht bis 360 px */
@media(max-width:360px){
  .memory-result{
    padding:3px!important;
    place-items:center!important;
  }
  .memory-result-card{
    width:calc(100% - 2px)!important;
    max-width:calc(100% - 2px)!important;
    min-width:0!important;
    padding:7px 5px 10px!important;
    border-width:2px!important;
    border-radius:14px!important;
  }
  .memory-result-graphic{
    width:min(82%,280px)!important;
    max-width:100%!important;
    margin:0 auto 5px!important;
  }
  .memory-result-stats{
    grid-template-columns:1fr 1fr!important;
    width:100%!important;
    min-width:0!important;
    padding:5px 3px!important;
    margin:0 auto 8px!important;
  }
  .memory-result-stats span{
    box-sizing:border-box!important;
    min-width:0!important;
    padding:3px 2px!important;
  }
  .memory-result-stats span:nth-child(3){
    grid-column:1 / -1!important;
    border-left:0!important;
    border-top:1px solid #e3d7bd!important;
    margin-top:4px!important;
    padding-top:6px!important;
  }
  .memory-result-stats small{font-size:.64rem!important;line-height:1.1!important}
  .memory-result-stats strong{
    max-width:100%!important;
    font-size:.82rem!important;
    line-height:1.12!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .memory-result-message{
    width:100%!important;
    max-width:100%!important;
    margin:7px 0 9px!important;
    padding:0 3px!important;
    font-size:.82rem!important;
    line-height:1.2!important;
    overflow-wrap:anywhere!important;
  }
  .memory-result-message span{font-size:.72rem!important;line-height:1.2!important}
  .memory-result #memory-again{
    box-sizing:border-box!important;
    width:calc(100% - 16px)!important;
    max-width:250px!important;
    min-width:0!important;
    padding:9px 8px!important;
    font-size:.92rem!important;
    white-space:normal!important;
  }
}


/* Spielmodus „Wer is wer?“ – alle Karten offen, Kopp und Name zuordnen */
.memory-board-whoiswho .memory-tile{transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.memory-board-whoiswho .memory-field:nth-child(2){background:rgba(255,248,207,.92)}
.memory-board-whoiswho .memory-field:nth-child(2) .memory-tile{border-color:#f2c431;background:#fffdf3}
.memory-board-whoiswho .memory-tile.is-selected{transform:translateY(-2px)}
.memory-board-whoiswho .memory-tile.is-wrong{border-color:#d92732;box-shadow:0 0 0 3px rgba(217,39,50,.22);animation:memoWrong .28s ease-in-out 2}
.memory-board-whoiswho .memory-tile.is-matched{filter:saturate(.82);box-shadow:0 0 0 2px rgba(37,132,75,.18)}
@keyframes memoWrong{0%,100%{transform:translateX(0)}35%{transform:translateX(-4px)}65%{transform:translateX(4px)}}
@media(prefers-reduced-motion:reduce){.memory-board-whoiswho .memory-tile.is-wrong{animation:none}.memory-board-whoiswho .memory-tile{transition:none}}

/* Erfolgsmeldung: immer im aktuell sichtbaren Bereich zentriert und weich eingeblendet */
.memory-result{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100vh!important;
  height:100dvh!important;
  display:grid!important;
  place-items:center!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:clamp(4px,2vh,16px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
}
.memory-result[hidden]{display:none!important}
.memory-result-card{
  margin:auto!important;
  max-height:calc(100% - 8px)!important;
  transform-origin:center center;
  animation:memoResultIn 2s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes memoResultIn{
  from{opacity:0}
  to{opacity:1}
}
@media(max-height:620px){
  .memory-result-card{padding-top:7px!important;padding-bottom:9px!important}
  .memory-result-graphic{width:min(72%,360px)!important;margin-bottom:3px!important}
  .memory-result-stats{margin-bottom:6px!important;padding-top:4px!important;padding-bottom:4px!important}
  .memory-result-message{margin:5px 0 7px!important}
  .memory-result #memory-again{padding-top:8px!important;padding-bottom:8px!important}
}
@media(prefers-reduced-motion:reduce){
  .memory-result-card{animation:none!important}
}

/* Ergebnisfenster – final: am sichtbaren Viewport zentriert, vollständig erreichbar, weich eingeblendet */
.memory-result{
  position:fixed!important;
  inset:0!important;
  z-index:9000!important;
  width:100vw!important;
  height:100vh!important;
  height:100dvh!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:8px!important;
  overflow:hidden!important;
}
.memory-result[hidden]{display:none!important}
.memory-result-card{
  flex:0 1 auto!important;
  margin:0!important;
  max-height:calc(100vh - 16px)!important;
  max-height:calc(100dvh - 16px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  animation:memoResultIn 2s cubic-bezier(.2,.75,.25,1) both!important;
  font-style:normal!important;
}
.memory-result-message,
.memory-result-message span{
  font-style:normal!important;
}
@media(max-height:760px){
  .memory-result-card{padding:7px 8px 10px!important}
  .memory-result-graphic{width:min(68%,340px)!important;margin-bottom:3px!important}
  .memory-result-stats{margin-bottom:5px!important;padding:4px 2px!important}
  .memory-result-message{margin:4px 0 6px!important;line-height:1.16!important}
  .memory-result #memory-again{padding:8px 12px!important}
}
@media(prefers-reduced-motion:reduce){.memory-result-card{animation:none!important}}

/* Freundlicher, gut sichtbarer Bildschirm-Tipp ab 24 Paaren auf kleinen Displays */
.memory-screen-tip{
  position:fixed;inset:0;z-index:8800;display:flex;align-items:center;justify-content:center;
  padding:16px;background:rgba(8,30,54,.76);box-sizing:border-box;
}
.memory-screen-tip[hidden]{display:none!important}
.memory-screen-tip-card{
  width:min(100%,460px);padding:0 24px 26px;border:4px solid #164f8b;border-radius:24px;overflow:hidden;
  background:#fffdf2;color:#173b64;text-align:center;box-shadow:0 24px 70px rgba(0,0,0,.42);
}
.memory-screen-tip-icon{
  margin:0 -24px;padding:15px 24px 5px;background:#ffd83d;color:#164f8b;
  font-size:2.35rem;line-height:1;
}
.memory-screen-tip h2{
  margin:0 -24px 16px;padding:5px 20px 15px;background:#ffd83d;color:#123f73;
  font-size:clamp(1.25rem,5vw,1.7rem);font-weight:900;
}
.memory-screen-tip p{margin:10px 0;line-height:1.5}
.memory-screen-tip button{
  display:inline-flex;align-items:center;justify-content:center;width:min(100%,330px);min-height:58px;
  margin:20px auto 2px;padding:14px 30px;border:0;border-radius:18px;
  background:linear-gradient(180deg,#1768ad 0%,#164f8b 58%,#0d3e70 100%);color:#fff;
  font:inherit;font-size:1.05rem;font-weight:900;letter-spacing:.015em;cursor:pointer;
  box-shadow:0 7px 0 #092f59,0 12px 24px rgba(9,47,89,.30),inset 0 1px 0 rgba(255,255,255,.32);
  text-shadow:0 1px 1px rgba(0,0,0,.2);
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}
.memory-screen-tip button:hover{
  filter:brightness(1.08);transform:translateY(-2px);
  box-shadow:0 9px 0 #092f59,0 16px 28px rgba(9,47,89,.32),inset 0 1px 0 rgba(255,255,255,.38);
}
.memory-screen-tip button:active{
  transform:translateY(4px);box-shadow:0 3px 0 #092f59,0 7px 14px rgba(9,47,89,.25),inset 0 1px 0 rgba(255,255,255,.25);
}
.memory-screen-tip button:focus-visible{outline:4px solid #ffd83d;outline-offset:4px}
@media(max-width:420px){.memory-screen-tip-card{padding-left:18px;padding-right:18px}.memory-screen-tip-icon,.memory-screen-tip h2{margin-left:-18px;margin-right:-18px}}
@media(prefers-reduced-motion:reduce){.memory-screen-tip button{transition:none}}
@media(prefers-reduced-motion:no-preference){.memory-screen-tip-card{animation:memoScreenTipIn .25s ease-out both}}
@keyframes memoScreenTipIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}

/* Einheitlicher Back-to-Top-Button auf Unterseiten */
.memo-to-top{
  position:fixed;right:20px;bottom:20px;z-index:8700;width:60px;height:60px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;background:#0e5a91;color:#fff;text-decoration:none;
  font-size:1.8rem;font-weight:900;line-height:1;box-shadow:0 5px 15px rgba(0,0,0,.28);
  transition:transform .16s ease,background-color .16s ease,box-shadow .16s ease;
}
.memo-to-top:hover{background:#164f8b;transform:translateY(-2px);box-shadow:0 8px 18px rgba(0,0,0,.3)}
.memo-to-top:focus-visible{outline:4px solid #ffd83d;outline-offset:3px}
@media(max-width:600px){.memo-to-top{width:50px;height:50px;right:12px;bottom:12px;font-size:1.55rem}}
@media(prefers-reduced-motion:reduce){.memo-to-top{transition:none}}
.memory-name-notice{position:fixed;z-index:10000;transform:translate(-50%,-50%);pointer-events:none!important}
.memory-name-notice[hidden]{display:none!important}
.memory-name-notice img{display:block;box-sizing:border-box;width:100%;height:auto;max-height:min(150px,24vh);object-fit:contain;padding:0;background:transparent;border:0;border-radius:0;box-shadow:none;pointer-events:none!important;animation:memoryMatchedName 1500ms ease-in-out both}
@keyframes memoryMatchedName{0%,100%{opacity:0}12%,80%{opacity:1}}
@media(prefers-reduced-motion:reduce){.memory-name-notice img{animation:none}}

/* Begrüßung für Gäste – passend zum Ergebnisfenster */
.memo-welcome{box-sizing:border-box;width:min(580px,calc(100% - 24px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);margin:auto;padding:24px 32px 30px;overflow:auto;border:4px solid #f2c431;border-radius:28px;background:linear-gradient(180deg,#fffef8,#fff8df);color:#173b64;text-align:center;box-shadow:0 24px 70px rgba(0,0,0,.38),inset 0 0 0 4px rgba(255,255,255,.75)}
.memo-welcome::backdrop{background:rgba(5,28,52,.76);backdrop-filter:blur(3px)}
.memo-welcome-hat{display:block;width:min(170px,38vw);max-height:110px;object-fit:contain;margin:0 auto 8px}
.memo-welcome-eyebrow{margin:6px 0 12px;font-size:.75rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.memo-welcome h2{margin:0 0 20px;font-size:clamp(1.55rem,5.6vw,2.25rem);line-height:1.15;font-weight:900;color:#164f8b}
.memo-welcome h2 span{color:#bd1724}
.memo-welcome p:not(.memo-welcome-eyebrow){margin:14px 0;line-height:1.55;font-size:1.05rem}
.memo-welcome-play{display:block;width:min(100%,360px);min-height:62px;margin:24px auto 20px;padding:16px 24px;border:0;border-radius:18px;background:linear-gradient(180deg,#1768ad,#164f8b 58%,#0d3e70);color:white;font:inherit;font-size:1.2rem;font-weight:900;cursor:pointer;box-shadow:0 7px 0 #092f59,0 12px 24px rgba(9,47,89,.3),inset 0 1px 0 rgba(255,255,255,.32);transition:transform .16s ease,filter .16s ease}
.memo-welcome-play:hover{filter:brightness(1.08);transform:translateY(-2px)}
.memo-welcome-play:active{transform:translateY(3px)}
.memo-welcome-account{display:inline-flex;align-items:center;min-height:44px;color:#164f8b;font-weight:700;text-underline-offset:3px}
.memo-welcome-account[hidden]{display:none}
.memo-welcome :focus-visible{outline:3px solid #164f8b;outline-offset:5px}
@media(max-width:420px),(max-height:650px){.memo-welcome{padding:16px 18px 20px}.memo-welcome-hat{max-height:70px}.memo-welcome h2{margin-bottom:12px}.memo-welcome p:not(.memo-welcome-eyebrow){font-size:1rem;margin:10px 0}}
@media(prefers-reduced-motion:no-preference){.memo-welcome[open]{animation:memoResultIn 2s cubic-bezier(.2,.75,.25,1) both}}
@media(prefers-reduced-motion:reduce){.memo-welcome-play{transition:none}}


/* Kompakter Ergebnisrahmen: Helau und Narrenkappe stehen frei darüber. */
.memory-result{width:100%!important;flex-direction:column!important;justify-content:flex-start!important;overflow-y:auto!important;padding:16px 8px!important}
.memory-result-card{width:min(540px,100%)!important;max-width:100%!important;isolation:isolate;flex:0 0 auto!important;margin:auto!important;padding:0 18px 18px!important;max-height:none!important;overflow:visible!important;background:transparent!important;border:0!important;box-shadow:none!important}
.memory-result-card::before{content:"";position:absolute;z-index:-1;inset:clamp(88px,20vw,150px) 0 0;pointer-events:none;background:linear-gradient(180deg,#fffef8 0%,#fff8df 100%);border:4px solid #f2c431;border-radius:24px;box-shadow:0 24px 70px rgba(0,0,0,.38),inset 0 0 0 4px rgba(255,255,255,.75)}
.memory-result-graphic{width:min(88%,400px)!important;max-width:100%!important;margin:0 auto 8px!important}
.memory-result-stats{margin-bottom:8px!important}
.memory-result-message{margin:6px 0 12px!important}
@media(max-width:480px){.memory-result-card{padding:0 12px 16px!important}.memory-result-card::before{border-width:3px;border-radius:18px}}
@media(max-height:500px){.memory-result-card::before{top:72px}.memory-result-graphic{width:min(64%,240px)!important}}

/* Hinweis unter dem Erfolgsbutton: nur fuer Gaeste sichtbar */
.memory-result-register-hint{max-width:430px;margin:12px auto 0!important;font-size:.9rem;line-height:1.35;font-weight:700;color:#334d66}
.memory-result-register-hint[hidden]{display:none!important}
.memory-result-register-hint a{color:#164f8b;font-weight:900;text-decoration:underline;text-underline-offset:2px}
.memory-result-register-hint a:focus-visible{outline:3px solid #164f8b;outline-offset:3px;border-radius:3px}
@media(max-width:600px){.memory-result-register-hint{max-width:290px;margin-top:16px!important;font-size:.76rem;line-height:1.25}}

/* 2026-09-24: Treffername im oberen Drittel des sichtbaren Viewports. */
.memory-name-notice{transform:translate(-50%,-50%)}

/* 2026-09-24: Auf Mobilgeraeten nur die Ergebniswerte vergroessern; Bezeichnungen bleiben unveraendert. */
@media(max-width:600px){
  .memory-result-stats strong{font-size:1.35rem!important;line-height:1.12}
}
@media(max-width:380px){
  .memory-result-stats strong{font-size:1.25rem!important}
}


/* Ergebnis: Aktionen */
.memory-result-actions{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:10px;margin-top:2px}
.memory-result-actions #memory-again{margin:0}
.memory-result-leaderboard{display:inline-flex;align-items:center;justify-content:center;min-width:min(260px,90%);padding:14px 26px;background:#164f8b;color:#fff;text-decoration:none;border:0;border-radius:14px;font-size:1.1rem;font-weight:900;box-shadow:0 5px 10px rgba(0,0,0,.15)}
.memory-result-leaderboard:hover{transform:translateY(-1px);filter:brightness(1.06)}
.memory-result-leaderboard:focus-visible{outline:4px solid #f2c431;outline-offset:3px}
.memory-result-leaderboard[hidden]{display:none!important}
@media(max-width:600px){.memory-result-actions{gap:8px}.memory-result-leaderboard{width:min(260px,92%);min-width:0;padding:10px 14px;font-size:1rem}}
@media(prefers-reduced-motion:reduce){.memory-result-leaderboard:hover{transform:none}}

/* SKTC: Links ohne Unterstreichung in allen Zuständen. */
a:any-link,a:any-link:hover,a:any-link:focus,a:any-link:focus-visible,a:any-link:active,a:any-link *{text-decoration:none!important}

/* SKTC: Flache Formularfelder ohne native 3D-Raender. */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="color"]),textarea,select){
 appearance:none;-webkit-appearance:none;box-shadow:none!important;background-image:none;border:1px solid #8b96a3!important;border-radius:8px;background-color:rgba(255,255,255,.8);color:inherit;font:inherit;box-sizing:border-box;
}
:where(input,textarea,select):focus-visible{outline:2px solid #224579;outline-offset:2px;box-shadow:none!important}
select{padding-right:2rem!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2330343b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right .65rem center!important;background-size:16px!important}
select[multiple],select[size]:not([size="1"]){background-image:none!important;padding-right:.65rem!important}
input[type="file"]::file-selector-button{border:1px solid #8b96a3;border-radius:8px;background:#f2f5f9;color:#30343b;box-shadow:none;font:inherit;padding:.5rem .8rem}

/* SKTC: Aktionsbuttons in Modal-Fenstern linksbuendig. */
:is(dialog,[role="dialog"],.modal-content) :is(button,input[type="submit"],input[type="button"],input[type="reset"],a.button,a.btn):not(.modal-close):not(.story-close):not(.close):not(.btn-close):not([aria-label][data-close]:empty){margin-left:0!important;margin-right:auto!important;align-self:flex-start!important}
:is(dialog,[role="dialog"],.modal-content) :is(.modal-footer,.dialog-actions,.modal-actions,.form-actions,.actions,.button-row){justify-content:flex-start!important;text-align:left!important}
:is(dialog,[role="dialog"],.modal-content) :is(form,.button-group,.buttons){text-align:left}
