/* ═══════════════════════════════════════════
   Artefakten Chaos — style.css
   ═══════════════════════════════════════════ */
:root {
  --gruen: #5a7a3a;
  --gruen-dark: #4a6530;
  --pb: linear-gradient(165deg, #f8f0e2, #ece0cc);
  --pr: #d4c0a0;
}

/* LOKALE SCHRIFTEN — offline-faehig */
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  src: url("../assets/fonts/Caveat/Caveat-VariableFont_wght.ttf")
    format("truetype");
}
@font-face {
  font-family: "Afacad";
  font-style: normal;
  font-weight: 400 600;
  src: url("../assets/fonts/Afacad/Afacad-VariableFont_wght.ttf")
    format("truetype");
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  font-family: "Afacad", "Josefin Sans", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* Skalier-Wrapper — 1920×1080 skaliert auf jedes Display */
#sw {
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
  background: transparent;
  overflow: visible;
}

/* ═══ HEADER (208px hoch) ═══ */
#hdr {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 208px;
  background: var(--gruen);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 52px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
  overflow: visible;
}
#hdr-s {
  font-family: "Caveat", cursive;
  font-size: 125px;
  color: #fff;
  white-space: nowrap;
  text-align: center;
}
#hdr-logo {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  height: 340px;
  display: flex;
  align-items: center;
}
#hdr-logo-img {
  height: 340px;
  width: auto;
  max-width: 700px;
  object-fit: contain;
}

/* ═══ BOARD (startet bei y=208px) ═══ */
#board {
  position: absolute;
  top: 208px;
  left: 0;
  width: 1920px;
  height: 872px;
  background-size: cover;
  background-position: center;
  background-color: transparent;
  overflow: visible;
}
#board::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  z-index: 1;
  pointer-events: none;
}

/* ═══ SANDUHR + ZAHLEN-TIMER (gemeinsamer schwebeblock) ═══ */
@keyframes schweben {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
#tmr-blk {
  position: absolute;
  top: -150px;
  left: 240px;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 30;
  animation: schweben 3s ease-in-out infinite;
}
#hg-con {
  position: relative;
  width: 220px;
  height: 220px;
}
.hgl {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  background: transparent;
}
.hgl img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#hg-st {
  z-index: 2;
  clip-path: inset(15.5% 20% 53% 20%);
  transition: clip-path 1s linear;
}
#hg-sb {
  z-index: 2;
  clip-path: inset(86% 20% 14% 20%);
  transition: clip-path 1s linear;
}
#hg-fr {
  z-index: 3;
}

/* ═══ ZAHLEN-TIMER — Kind von #tmr-blk, zentriert durch flexbox ═══ */
#tmr-disp {
  width: fit-content;
  text-align: center;
  font-family: "Afacad", "Josefin Sans", sans-serif;
  font-size: 38px;
  font-weight: 600;
  color: #fff;
  background: rgba(60, 30, 5, 0.6);
  border-radius: 8px;
  padding: 4px 18px;
  letter-spacing: 0.06em;
  text-shadow: 1px 2px 6px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  white-space: nowrap;
}

/* ═══ MASKOTTCHEN ═══ */
#maskottchen {
  position: absolute;
  top: -50px;
  left: 50px;
  width: 350px;
  height: 600px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 29;
}
#maskottchen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ═══ KARTEN ═══ */
#cards-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}
#cards-layer .acard {
  pointer-events: all;
}

.acard {
  position: absolute;
  width: 220px;
  height: 220px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s;
}
.acard img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  pointer-events: none;
  background: transparent;
  display: block;
}
.acard:hover {
  transform: scale(1.05);
  z-index: 50;
}
.acard.dragging {
  cursor: grabbing;
  z-index: 200;
  transition: none !important;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0) rotate(var(--br, 0deg));
  }
  15% {
    transform: translateX(-15px) rotate(var(--br, 0deg));
  }
  30% {
    transform: translateX(15px) rotate(var(--br, 0deg));
  }
  50% {
    transform: translateX(-10px) rotate(var(--br, 0deg));
  }
  70% {
    transform: translateX(10px) rotate(var(--br, 0deg));
  }
  88% {
    transform: translateX(-4px) rotate(var(--br, 0deg));
  }
}
.acard.shake {
  animation: shake 0.5s ease both;
}

/* ═══ DROP-ZONEN ═══ */
#dzones {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 34px;
  z-index: 10;
}
.dzone {
  width: 384px;
  height: 320px;
  background: var(--pb);
  border: 2px solid var(--pr);
  border-radius: 5px;
  box-shadow:
    5px 7px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 6px 0;
  position: relative;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.dzone::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(165deg, #f0e6d2, #e6dac6);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 0 0 4px 4px;
  z-index: 0;
}
.dzone.drag-over {
  transform: scale(1.04) translateY(-4px);
  box-shadow:
    5px 7px 30px rgba(90, 122, 58, 0.6),
    inset 0 0 0 3px var(--gruen);
}
@keyframes fG {
  0%,
  100% {
    background: var(--pb);
  }
  45% {
    background: linear-gradient(165deg, #b8f0a0, #80e060);
  }
}
@keyframes fR {
  0%,
  100% {
    background: var(--pb);
  }
  45% {
    background: linear-gradient(165deg, #f8b8a8, #f08070);
  }
}
.dzone.cf {
  animation: fG 0.55s ease;
}
.dzone.wf {
  animation: fR 0.55s ease;
}
.zone-inner {
  flex: 1;
  background: transparent;
  margin-bottom: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.zone-ph {
  width: 100%;
  height: 100%;
  opacity: 1;
  object-fit: cover;
  pointer-events: none;
  display: block;
}
.zlbl {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 38px;
  font-weight: 700;
  color: #3a6820;
  z-index: 2;
  pointer-events: none;
}

/* ═══ INFO-POPUP ═══ */
#info-ov {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  align-items: center;
  justify-content: center;
}
#info-ov.show {
  display: flex;
}
#info-bd {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
#info-pop {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  animation: nI 0.28s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}
@keyframes nI {
  from {
    transform: scale(0.2) rotate(-4deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}
.note {
  position: relative;
  flex-shrink: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
}
/* Tafel Querformat — größer */
.note-de {
  width: 1100px;
  height: 820px;
}
.note-tape {
  display: none;
}
/* Textbereich in die gestrichelte Markierung */
.note-content {
  position: absolute;
  top: 15%;
  left: 14.5%;
  width: 73%;
  height: 70%;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 250px;
  grid-template-areas:
    "name  img"
    "text  img";
  gap: 8px 16px;
  overflow: hidden;
}
.note-flag {
  display: none;
}
.note-name {
  grid-area: name;
  font-family: "Caveat", cursive;
  font-size: 36px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.35),
    1px 1px 0 rgba(0, 0, 0, 0.25);
  line-height: 1.1;
  align-self: end;
}
.note-img {
  grid-area: img;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
  padding-top: 4px;
}
.note-img img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
}
.note-hr {
  display: none;
}
.note-text-wrap {
  grid-area: text;
  overflow: hidden;
  padding: 0;
}
.note-text {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.75;
}
.note-de .note-text {
  font-family: "Afacad", "Josefin Sans", sans-serif;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.25),
    1px 1px 0 rgba(0, 0, 0, 0.15);
}
.note-text::-webkit-scrollbar {
  width: 4px;
}
.note-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}
#info-x {
  position: absolute;
  top: 0;
  right: 0;
  width: 96px;
  height: 96px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#info-x:active {
  transform: scale(0.93);
}

#info-x:hover {
  background: transparent;
}
#info-x img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ═══ SHUTDOWN ═══ */
.sdz {
  position: fixed;
  width: 100px;
  height: 100px;
  z-index: 10000;
  background: transparent;
  touch-action: none;
}
#sdz-tl {
  top: 0;
  left: 0;
}
#sdz-tr {
  top: 0;
  right: 0;
}
#sd-ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 11000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
}
#sd-ov.show {
  display: flex;
}
#sd-msg {
  display: none;
}
#sd-dots {
  display: flex;
  gap: 20px;
}
.sdd {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition:
    background 0.25s,
    transform 0.25s;
}
.sdd.on {
  background: #fff;
  transform: scale(1.35);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.8);
}
#sd-hint {
  display: none;
}

/* ═══ END-SCREENS ═══ */
#end-ov,
#slow-ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#end-ov.show,
#slow-ov.show {
  display: flex;
}
.end-box {
  background: var(--pb);
  border: 3px solid var(--pr);
  border-radius: 14px;
  padding: 50px 100px;
  text-align: center;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.65);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 900px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
@keyframes popIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.end-img {
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.end-img img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}
.end-img:empty {
  display: none;
}
.end-box h2 {
  font-family: "Caveat", cursive;
  font-size: 80px;
  color: #3a6820;
  margin: 0;
}
.end-box p {
  font-size: 28px;
  color: #555;
  margin: 0;
}
.btn-r {
  font-family: "Afacad", "Josefin Sans", sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gruen);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 20px 60px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition:
    background 0.2s,
    transform 0.1s;
  margin-top: 10px;
}
#btn-reset-img,
#btn-reset-img-slow {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}
.btn-r:hover {
  background: var(--gruen-dark);
  transform: scale(1.04);
}
.btn-r:active {
  transform: scale(0.97);
}
