/* v954 – Admin-Panel (Code-Fenster, Panel) und Aufpasser im Wirtshaus */
.ap-box-v954 {
  position: fixed;
  z-index: 200000;
  box-sizing: border-box;
  background: rgba(45, 31, 22, .96);
  border: 2px solid rgba(122, 86, 52, .92);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 20px rgba(0, 0, 0, .55);
  color: #f5e2b7;
  font-family: Georgia, "Times New Roman", serif;
}
.ap-code-v954 {
  left: 50%;
  top: 50%;
  width: 280px;
  padding: 18px 20px 16px;
  transform: translate(-50%, -50%);
  text-align: center;
}
.ap-code-v954.shake { animation: apShakeV954 .35s ease; }
@keyframes apShakeV954 {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% - 8px), -50%); }
  50% { transform: translate(calc(-50% + 7px), -50%); }
  75% { transform: translate(calc(-50% - 4px), -50%); }
}
.ap-title-v954 { font-size: 18px; font-weight: 700; color: #ffe6a5; }
.ap-code-v954 input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  padding: 9px 10px;
  border: 2px solid #7a5634;
  border-radius: 8px;
  background: #1f1610;
  color: #fff3d6;
  font: 700 20px/1.1 Georgia, "Times New Roman", serif;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
}
.ap-code-v954 input:focus { border-color: #bd8745; }
.ap-msg-v954 { min-height: 18px; margin-top: 6px; font-size: 13px; color: #ff9a7a; }
.ap-row-v954 { display: flex; gap: 8px; margin-top: 8px; }
.ap-btn-v954 {
  flex: 1;
  padding: 9px 8px;
  border: 2px solid rgba(122, 86, 52, .92);
  border-radius: 10px;
  background: rgba(45, 31, 22, .88);
  color: #f5e2b7;
  font: 700 14px Georgia, "Times New Roman", serif;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 2px 5px rgba(0, 0, 0, .38);
}
.ap-btn-v954.primary { border-color: #bd8745; color: #ffe6a5; }
.ap-btn-v954:hover:not(:disabled) { filter: brightness(1.15); }
.ap-btn-v954:disabled { opacity: .45; cursor: not-allowed; }

.ap-panel-v954 {
  left: 24px;
  top: 150px;
  width: 240px;
  padding: 12px 14px 14px;
}
.ap-head-v954 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ap-close-v954 {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid rgba(122, 86, 52, .92);
  border-radius: 8px;
  background: rgba(31, 22, 16, .9);
  color: #f5e2b7;
  font: 700 18px/1 Georgia, serif;
  cursor: pointer;
}
.ap-wide-v954 { width: 100%; }
.ap-hint-v954 { margin-top: 7px; font-size: 12px; opacity: .75; text-align: center; }

/* ---------- Aufpasser im Wirtshaus (1600x900-Bühne) ---------- */
.ap-watcher-v954 {
  position: fixed;          /* Lage/Größe setzt das Skript passend zum Wirtshaus-Bild */
  left: 0;
  top: 0;
  width: 150px;
  height: 370px;
  z-index: 2147483647;      /* über der Abdunklung */
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
/* Etwas durchsichtig */
.ap-watcher-v954.show { opacity: .72; }
.ap-watcher-v954 img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(120, 170, 220, .45));
  /* ganz sanftes Schweben (nur wenige Pixel) + unruhiges Geister-Flackern */
  animation:
    apBobV954 5s ease-in-out infinite,
    apFlickerV954 3.7s steps(1, end) infinite;
}
@keyframes apBobV954 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes apFlickerV954 {
  0%   { opacity: 1; }
  8%   { opacity: .82; }
  10%  { opacity: 1; }
  31%  { opacity: .9; }
  33%  { opacity: .6; }
  35%  { opacity: .95; }
  37%  { opacity: .7; }
  39%  { opacity: 1; }
  62%  { opacity: .88; }
  64%  { opacity: 1; }
  81%  { opacity: .55; }
  83%  { opacity: .9; }
  85%  { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-watcher-v954 img { animation: none; }
}

/* ---------- v963: Kicken / Time Out ---------- */
.ap-mt-v954 { margin-top: 8px; }
.ap-btn-v954.active { background: #6b3a22; border-color: #e6a35a; color: #fff3d6; box-shadow: 0 0 0 2px rgba(230, 163, 90, .35); }

/* Auswahlmodus: Spielernamen im Wirtshaus werden anklickbar */
body.ap-picking-v954 .inn-player-v639 .inn-player-label-v639 {
  pointer-events: auto !important;
  cursor: pointer !important;
  border-color: #ffb45c !important;
  background: #7a3b1c !important;
  color: #fff3d6 !important;
  animation: apPickPulseV963 1.1s ease-in-out infinite;
}
body.ap-picking-v954 .inn-player-v639 .inn-player-label-v639:hover { background: #a54a1e !important; }
@keyframes apPickPulseV963 {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 180, 92, .55), 0 0 12px 2px rgba(255, 150, 60, .55); }
  50% { box-shadow: 0 0 0 3px rgba(255, 200, 120, .95), 0 0 22px 6px rgba(255, 150, 60, .9); }
}

/* Meldung vom Aufpasser: sperrt das ganze Spiel */
.ap-notice-v954 {
  position: fixed;
  inset: 0;
  /* höchste mögliche Ebene: einige Spiel-Elemente (z. B. Monster auf der Plattform) liegen sehr weit oben */
  z-index: 2147483647 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(8, 10, 16, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.ap-notice-card-v954 {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(520px, 100%);
  box-sizing: border-box;
  padding: 18px 22px 18px 14px;
  background: rgba(45, 31, 22, .97);
  border: 2px solid rgba(122, 86, 52, .92);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 30px rgba(0, 0, 0, .6);
  color: #f5e2b7;
  font-family: Georgia, "Times New Roman", serif;
}
/* Einblenden nur beim ersten Erscheinen (nicht erneut, wenn die Meldung nach oben umgehängt wird) */
.ap-notice-card-v954.enter { animation: apNoticeInV963 .35s ease-out; }
@keyframes apNoticeInV963 { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.ap-notice-img-v954 {
  flex: 0 0 auto;
  width: 96px;
  height: 236px;
  object-fit: contain;
  opacity: .85;
  filter: drop-shadow(0 0 12px rgba(120, 170, 220, .5));
  animation: apBobV954 5s ease-in-out infinite;
}
.ap-notice-body-v954 { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; }
.ap-notice-from-v954 { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #d8b872; }
.ap-notice-text-v954 { font-size: 20px; font-weight: 700; line-height: 1.3; color: #ffe6a5; }
.ap-notice-sub-v954 { font-size: 13px; opacity: .8; }
.ap-notice-clock-v954 {
  align-self: center;
  text-align: center;
  padding: 2px 0;
  color: #aee8ff;
  font: 700 34px/1.1 ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.ap-notice-clock-v954.done { color: #9be58f; }
.ap-notice-btn-v954 { flex: 0 0 auto; padding: 10px 12px; font-size: 15px; }
@media (max-width: 520px) {
  .ap-notice-img-v954 { width: 64px; height: 160px; }
  .ap-notice-text-v954 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-notice-img-v954, body.ap-picking-v954 .inn-player-v639 .inn-player-label-v639 { animation: none; }
}

/* ---------- v967: Time-Out-Dauer wählen ---------- */
.ap-dur-v954 { margin-top: 6px; padding: 8px; border: 1px solid rgba(122, 86, 52, .7); border-radius: 10px; background: rgba(31, 22, 16, .55); }
.ap-dur-v954[hidden] { display: none; }
.ap-dur-grid-v954 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ap-dur-btn-v954 { padding: 6px 4px; font-size: 13px; }
.ap-dur-own-v954 { display: flex; gap: 6px; margin-top: 6px; }
.ap-dur-input-v954,
.ap-dur-unit-v954 {
  min-width: 0;
  box-sizing: border-box;
  padding: 5px 6px;
  border: 2px solid #7a5634;
  border-radius: 8px;
  background: #1f1610;
  color: #fff3d6;
  font: 700 13px Georgia, "Times New Roman", serif;
  outline: none;
  color-scheme: dark;
}
.ap-dur-input-v954 { flex: 1 1 auto; width: 0; text-align: center; }
.ap-dur-input-v954:focus, .ap-dur-unit-v954:focus { border-color: #bd8745; }
.ap-dur-input-v954.bad { border-color: #d0573a; }
.ap-dur-unit-v954 { flex: 0 0 auto; }
.ap-dur-ok-v954 { flex: 0 0 auto; padding: 5px 10px; font-size: 13px; }

/* ---------- v968: Abdunklung, solange der Aufpasser unterwegs ist ---------- */
.ap-dark-v965 {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(4, 6, 12, .78);
  opacity: 0;
  transition: opacity .7s ease;
  cursor: not-allowed;
}
.ap-dark-v965.on { opacity: 1; }

/* ---------- v1002: Spielstand Reset ---------- */
.ap-btn-v954.ap-reset-v1002 { border-color: #a8442c; color: #ffd2c4; }
.ap-reset-box-v1002 { width: 340px; z-index: 2147483000; }
.ap-reset-text-v1002 { margin: 10px 0 6px; font-size: 14px; line-height: 1.45; color: #f5e2b7; }

/* ---------- v1003: Gold / Monster ---------- */
.ap-panel-v954 { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #7a5634 transparent; }
.ap-sub-v1003 { margin-top: 6px; }
.ap-sub-title-v1003 { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: #ffe6a5; text-align: center; }
.ap-sub-msg-v1003 { margin-top: 6px; }
.ap-sub-msg-v1003.bad { color: #ff9a7a; opacity: 1; }
.ap-mon-list-v1003 .ap-btn-v954 { font-size: 13px; padding: 7px 8px; }
body .ap-panel-v954 .ap-sub-v1003 button.ap-btn-v954.active { background: linear-gradient(#b8642c, #8a4318) !important; border-color: #ffcf86 !important; color: #fff8e6 !important; box-shadow: 0 0 0 2px rgba(255, 207, 134, .45), 0 0 10px rgba(255, 170, 80, .45) !important; }

/* ---------- v1004: Panel ein-/ausklappen ---------- */
.ap-title-wrap-v1004 { display: flex; align-items: center; gap: 8px; }
body .ap-panel-v954 .ap-head-v954 .ap-title-wrap-v1004 button.ap-fold-v1004.ap-fold-v1004 {
  width: 26px !important;
  height: 26px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* gelbes Dreieck (zeigt nach unten = ausklappen, nach oben = einklappen) */
.ap-fold-v1004::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid #ffd23f;
  filter: drop-shadow(0 0 4px rgba(255, 200, 60, .7)) drop-shadow(0 1px 1px #000);
  transition: transform .2s ease;
}
.ap-fold-v1004.up-v1004::before { transform: rotate(180deg); }
body .ap-panel-v954 .ap-head-v954 .ap-title-wrap-v1004 button.ap-fold-v1004.ap-fold-v1004:hover { filter: brightness(1.2) !important; }
.ap-panel-v954.collapsed-v1004 .ap-body-v1004 { display: none; }
.ap-panel-v954.collapsed-v1004 .ap-head-v954 { margin-bottom: 0; }
