.ptkp-wrap{
  display:flex; justify-content:center; align-items:flex-start;
  padding:16px; padding-bottom:60px; box-sizing:border-box;
  background: radial-gradient(circle at top, #ffe8a3, #ffb3d9);
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}
.ptkp-card{
  transform: scale(0.85);
  transform-origin: top center;
  width:min(820px, 100%);
  background: rgba(255,255,255,0.95);
  border-radius: 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
  padding: 18px 18px 22px;
  text-align:center;
  position:relative;
  overflow:hidden;
}
.ptkp-header h1{ margin: 6px 0 4px; font-size: 2.2rem; }
.ptkp-header p{ margin: 0 0 14px; font-size: 1.1rem; opacity:.85; }

.ptkp-btn{
  font-size: 1.35rem;
  padding: 12px 22px;
  background: linear-gradient(135deg, #ff7ad9, #ffcc33);
  border:none;
  border-radius: 999px;
  cursor:pointer;
  color:white;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.ptkp-btn:active{ transform: scale(.98); }
.ptkp-btn-secondary{ background: linear-gradient(135deg, #6fb8ff, #00cec9); }

.ptkp-preview{ display:flex; justify-content:center; margin: 12px 0 14px; }
.ptkp-preview-box{
  width: min(420px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  background: linear-gradient(135deg, #e8f5ff, #fff6e0);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  position:relative;
  overflow:hidden;
}
.ptkp-preview-box::after{
  content:"";
  position:absolute; inset:0;
  background: rgba(255,255,255,.35);
}
.ptkp-preview-badge{
  position:absolute; left:12px; top:12px;
  background: rgba(0,0,0,.55);
  color:white;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  z-index: 2;
}
.ptkp-hint{ margin-top: 10px; font-size: 1rem; opacity: .85; }

.ptkp-topbar{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
  margin: 4px 0 10px;
  flex-wrap: wrap;
}
.ptkp-pill{
  background: rgba(255,255,255,0.9);
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
  font-weight: 900;
}

.ptkp-board-area{
  position:relative;
  width: 100%;
  margin: 0 auto;
  max-width: 760px;
}
.ptkp-board{
  width: 100%;
  aspect-ratio: 3 / 4; /* passt gut zu 9:16, aber bleibt responsiv */
  max-height: 72vh;
  border-radius: 24px;
  background: linear-gradient(#6fb8ff, #e6f7ff);
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.6), 0 10px 30px rgba(0,0,0,.12);
  position:relative;
  overflow:hidden;
  margin: 0 auto;
}
.ptkp-slot{
  position:absolute;
  border-radius: 18px;
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.08);
  background: rgba(255,255,255,.55);
}
.ptkp-slot::after{
  content:"";
  position:absolute; inset:10px;
  border-radius: 14px;
  border: 3px dashed rgba(0,0,0,.12);
}

.ptkp-piece{
  position:absolute;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,.20);
  touch-action:none;
  cursor: grab;
  user-select:none;
}
.ptkp-piece:active{ cursor: grabbing; }
.ptkp-piece.ptkp-locked{
  box-shadow: 0 6px 14px rgba(0,0,0,.16);
}

.ptkp-tray{
  margin-top: 12px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.ptkp-tray-title{ font-weight: 900; margin-bottom: 6px; }
.ptkp-tray-inner{
  position:relative;
  height: 22vh;
  min-height: 150px;
  max-height: 260px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,.35));
  overflow:hidden;
}

.ptkp-confetti{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.ptkp-win h2{ font-size: 2rem; margin: 10px 0 6px; }
.ptkp-win p{ margin: 0 0 14px; font-size: 1.1rem; opacity:.85; }

.ptkp-draglayer{ position:absolute; inset:0; pointer-events:none; }
.ptkp-draglayer .ptkp-piece{ pointer-events:auto; }

.ptkp-gallery{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin: 6px 0 14px; }
.ptkp-thumb{ width:110px; height:110px; border-radius:18px; overflow:hidden; border:4px solid rgba(0,0,0,.05); box-shadow:0 4px 14px rgba(0,0,0,.14); background:#fff; cursor:pointer; padding:0; }
.ptkp-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.ptkp-thumb.ptkp-thumb-selected{ outline:6px solid rgba(255,122,217,.55); }

.ptkp-difficulty{ margin: 6px 0 14px; }
.ptkp-difficulty-title{ font-weight: 900; margin-bottom: 8px; font-size: 1.1rem; }
.ptkp-difficulty-options{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.ptkp-diff-btn{
  width: 88px; height: 64px;
  border-radius: 18px;
  border: 3px solid rgba(0,0,0,.06);
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
}
.ptkp-diff-btn:active{ transform: scale(.98); }
.ptkp-diff-btn.ptkp-diff-selected{ outline: 6px solid rgba(255,122,217,.55); }


/* Geschafft-Popup: mittig im Bildschirm */
.ptkp-win{
  position: fixed;
  inset: 0;
  display: none; /* wird per JS auf flex gesetzt */
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(2px);
  z-index: 9999;
}
.ptkp-win-box{
  width: min(780px, 92vw);
  border-radius: 26px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 28px 24px;
  text-align: center;
}


/* --- Win-Popup (Geschafft) als echtes Fullscreen-Modal --- */
#ptkp-win.ptkp-win, #ptkp-win{
  position: fixed !important;
  inset: 0 !important;
  display: none; /* JS setzt flex */
  align-items: center !important;
  justify-content: center !important;
  padding: 28px 18px !important;
  background: rgba(255,255,255,0.55) !important;
  backdrop-filter: blur(2px);
  z-index: 99999 !important;
}

#ptkp-win .ptkp-win-box{
  width: min(760px, 92vw);
  max-height: 80vh;
  overflow: auto;
  border-radius: 26px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 14px 44px rgba(0,0,0,0.18);
  padding: 28px 22px;
  text-align: center;
}
