/* "Zgłoś uwagę" (js/feedback.js): a discreet button in the bottom bar beside #credits and a paper card
   (phone: bottom sheet) with the report form. The button lives inside #credits, so it hides with the
   credits during the intro, the tour and the bottom cards (intro.css / tour.css / eggs.css / zaduszki.css). */
#fbBtn { position: absolute; right: 100%; bottom: 0; margin-right: 10px; pointer-events: auto; display: inline-flex; align-items: center;
  gap: 5px; padding: 2px 6px; font-family: "Silkscreen", monospace; font-size: 10px; line-height: 1.3; color: var(--ink); white-space: nowrap;
  background: rgba(244, 236, 216, .55); border: 2px solid rgba(43, 36, 51, .35); cursor: pointer; opacity: .7; transition: opacity .15s steps(2, end); }
#fbBtn:hover, #fbBtn:focus-visible, #fbBtn.active { opacity: 1; background: var(--paper); border-color: var(--ink); outline: 0; }
#fbBtn:focus-visible { box-shadow: 2px 2px 0 var(--ink); }
#fbBtn:active { transform: translate(1px, 1px); }
#fbBtn svg { display: block; width: 12px; height: 12px; image-rendering: pixelated; }
body.intro-on #fbBtn { pointer-events: none; }

/* the card: desktop bottom-right above the credits; z above the layers sheet (30) */
#pkFeedback { position: fixed; right: 8px; bottom: 44px; z-index: 40; width: 340px; max-height: calc(100vh - 60px); overflow: auto;
  overscroll-behavior: contain; background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 8px 10px 10px; }
#pkFeedback[hidden] { display: none; }
#pkFeedback .fb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#pkFeedback .fb-head b { font-weight: 600; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; }
#pkFeedback .fb-x { font: inherit; font-size: 16px; width: 30px; height: 28px; background: none; border: 0; cursor: pointer; color: var(--ink); }
#pkFeedback .fb-lead { font-family: system-ui, sans-serif; font-size: 12px; line-height: 1.35; margin: 0 0 6px; opacity: .85; }
#pkFeedback .fb-lbl { display: block; font-family: "Silkscreen", monospace; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; opacity: .75; margin: 7px 0 3px; }
#pkFeedback select, #pkFeedback textarea, #pkFeedback input[type="email"] { display: block; width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 2px solid var(--ink); border-radius: 0; padding: 5px 6px; -webkit-appearance: none; appearance: none; }
#pkFeedback select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
#pkFeedback textarea { min-height: 76px; resize: vertical; font-family: system-ui, sans-serif; line-height: 1.35; }
#pkFeedback select:focus-visible, #pkFeedback textarea:focus-visible, #pkFeedback input[type="email"]:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
#pkFeedback .fb-cnt { font-family: "Silkscreen", monospace; font-size: 9px; opacity: .6; text-align: right; margin-top: 2px; }
#pkFeedback .fb-cnt.over { opacity: 1; color: #a3261a; }
/* pixel checkbox like the layers grid */
#pkFeedback .fb-chk { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; padding: 3px 0; user-select: none; margin-top: 6px; }
#pkFeedback .fb-chk input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
#pkFeedback .fb-chk i { width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid var(--ink); background: #fff; position: relative; }
#pkFeedback .fb-chk input:checked + i { background: var(--accent); }
#pkFeedback .fb-chk input:checked + i::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 8px;
  border: solid var(--ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
#pkFeedback .fb-chk input:focus-visible + i { outline: 2px dashed var(--ink); outline-offset: 2px; }
/* honeypot: off-screen, never display:none (bots skip hidden fields) */
#pkFeedback .fb-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
#pkFeedback .fb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
#pkFeedback .fb-send { font: inherit; font-size: 14px; padding: 6px 14px; background: var(--accent); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
#pkFeedback .fb-send:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
#pkFeedback .fb-send:disabled { opacity: .5; cursor: default; }
#pkFeedback .fb-send:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
#pkFeedback .fb-where { font-family: system-ui, sans-serif; font-size: 11px; opacity: .7; line-height: 1.3; }
#pkFeedback .fb-msg { font-family: system-ui, sans-serif; font-size: 13px; line-height: 1.35; margin-top: 8px; padding: 6px 8px; border: 2px solid var(--ink); background: #fff; }
#pkFeedback .fb-msg[hidden] { display: none; }
#pkFeedback .fb-msg.err { background: #f9d9d3; border-color: #a3261a; }
#pkFeedback .fb-msg.ok { background: #e4f0d2; border-color: #4e7a2a; }
#pkFeedback .fb-done { text-align: center; padding: 16px 4px 10px; }
#pkFeedback .fb-done b { display: block; font-size: 18px; font-weight: 600; margin-bottom: 6px; }
#pkFeedback .fb-done p { font-family: system-ui, sans-serif; font-size: 13px; margin: 0 0 12px; }
#pkFeedback .fb-done svg { display: block; margin: 0 auto 8px; width: 36px; height: 36px; image-rendering: pixelated; }
#pkFeedback .fb-again { font: inherit; font-size: 13px; background: #fff; border: 2px solid var(--ink); padding: 5px 10px; cursor: pointer; }
#pkFeedback .fb-priv { font-family: system-ui, sans-serif; font-size: 10px; opacity: .6; margin-top: 8px; line-height: 1.3; }

/* phone portrait: a bottom sheet like the layers panel; the button sits above the credits, left */
@media (max-width: 600px) {
  #fbBtn { right: auto; left: 0; bottom: 100%; margin: 0 0 4px; }
  #pkFeedback { left: 0; right: 0; bottom: 0; width: auto; max-height: 86vh; border-width: 3px 0 0; box-shadow: 0 -3px 0 rgba(43, 36, 51, .25);
    padding: 6px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #pkFeedback .fb-head b { font-size: 13px; }
  #pkFeedback .fb-lead { font-size: 11px; margin-bottom: 2px; }
  #pkFeedback select, #pkFeedback textarea, #pkFeedback input[type="email"] { font-size: 16px; } /* no iOS zoom on focus */
  #pkFeedback textarea { min-height: 64px; }
  #pkFeedback .fb-lbl { margin-top: 5px; }
}
@media (max-height: 520px) { #pkFeedback { max-height: calc(100vh - 16px); bottom: 8px; } #pkFeedback textarea { min-height: 48px; } }
