/* Player feedback + private developer inbox. Namespaced to avoid touching the
   game surfaces; the player entry lives inside the existing settings sheet. */

:root {
  --mj-feedback-ink: #f8f3e8;
  --mj-feedback-muted: rgba(248, 243, 232, 0.58);
  --mj-feedback-panel: #0d2137;
  --mj-feedback-panel-2: #132c47;
  --mj-feedback-line: rgba(255, 255, 255, 0.11);
  --mj-feedback-gold: #e58d00;
  --mj-feedback-gold-soft: rgba(229, 141, 0, 0.14);
  --mj-feedback-green: #45c58a;
  --mj-feedback-red: #ff786c;
}

.mj-feedback-sr-only {
  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;
}

/* ── Shared Majlis feedback mark ───────────────────────────────────────── */
.mj-feedback-mark {
  width: 26px;
  height: 26px;
  display: block;
  color: currentColor;
}
.mj-feedback-mark path:first-child { fill: currentColor; }
.mj-feedback-mark .mj-feedback-mark-cut { fill: #0d2137; }

/* ── Player: icon inside the existing settings sheet ───────────────────── */
/* The same rounded-square icon button as the public feedback entry and the
   discovery screen's back/settings buttons. */
.ps-card { position: relative; }
.mj-feedback-entry {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 2px solid #052637;
  border-radius: 15px;
  background: #03476b;
  color: #fff7e8;
  box-shadow: 0 4px 8px rgba(0, 35, 55, 0.4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
  transition: transform 140ms cubic-bezier(.2, .9, .3, 1), background-color 140ms linear;
}
.ps-title > .mj-feedback-entry { top: calc(50% - 24px); right: 0; }
.mj-feedback-entry.is-ready { display: flex; }
.mj-feedback-entry .mj-feedback-mark-cut { fill: #03476b; }
.mj-feedback-entry:active { transform: scale(0.92); background: #023a58; }
.mj-feedback-entry:focus-visible {
  outline: 3px solid #f3a400;
  outline-offset: 3px;
}

/* Presented by MJSheet (feedback-sheet.js/.css): dim backdrop, slide up,
   pull down to dismiss. */
.mj-feedback-sheet {
  position: relative;
  width: 100%;
  max-height: min(88vh, 680px);
  max-height: min(88dvh, 680px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--mj-feedback-line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 85% -20%, rgba(229, 141, 0, 0.18), transparent 38%),
    var(--mj-feedback-panel);
  color: var(--mj-feedback-ink);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
}
.mj-feedback-grab {
  margin: 0 -20px 6px;
  padding: 0 0 8px;
  touch-action: none;
}
.mj-feedback-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  margin-bottom: 14px;
  color: #f3a51a;
}
.mj-feedback-head h2 {
  margin: 0;
  color: var(--mj-feedback-ink);
  font: 900 1.23rem/1.3 "Cairo", system-ui, sans-serif;
}
.mj-feedback-close {
  position: absolute;
  top: 22px;
  left: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: var(--mj-feedback-ink);
  box-shadow: none;
  transition: transform 140ms cubic-bezier(.2, .9, .3, 1), background 140ms linear;
}
.mj-feedback-close:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.07); }
.mj-feedback-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.mj-feedback-person {
  width: fit-content;
  max-width: 100%;
  margin: -4px auto 14px;
  padding: 5px 11px;
  overflow: hidden;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 999px;
  color: var(--mj-feedback-muted);
  font-size: .78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mj-feedback-kinds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 11px;
  direction: rtl;
}
.mj-feedback-kind,
.mj-feedback-channel {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.57);
  box-shadow: none;
  cursor: pointer;
  transition: transform 130ms ease, color 130ms ease, background 130ms ease, border-color 130ms ease;
}
.mj-feedback-kind svg,
.mj-feedback-channel svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mj-feedback-kind.is-selected,
.mj-feedback-channel.is-selected {
  border-color: rgba(229, 141, 0, 0.78);
  background: var(--mj-feedback-gold-soft);
  color: #f3a51a;
}
.mj-feedback-kind:active,
.mj-feedback-channel:active { transform: scale(.92); }
.mj-feedback-message,
.mj-feedback-contact {
  width: 100%;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 16px;
  outline: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--mj-feedback-ink);
  font: 700 1rem/1.65 "Cairo", system-ui, sans-serif;
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease;
}
.mj-feedback-message {
  min-height: 116px;
  max-height: 210px;
  resize: vertical;
  padding: 14px 15px;
  margin-bottom: 10px;
}
.mj-feedback-message::placeholder,
.mj-feedback-contact::placeholder { color: rgba(255, 255, 255, 0.36); }
.mj-feedback-message:focus,
.mj-feedback-contact:focus {
  border-color: rgba(229, 141, 0, 0.72);
  background: rgba(255, 255, 255, 0.075);
}
.mj-feedback-reply {
  display: grid;
  grid-template-columns: 48px 48px minmax(0, 1fr);
  gap: 8px;
  direction: ltr;
}
.mj-feedback-contact {
  height: 48px;
  min-width: 0;
  padding: 0 13px;
  direction: ltr;
  text-align: left;
}
.mj-feedback-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 3px 12px;
  color: var(--mj-feedback-muted);
  font-size: .75rem;
  font-weight: 700;
}
.mj-feedback-privacy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.mj-feedback-error {
  min-height: 22px;
  margin: -2px 2px 5px;
  color: var(--mj-feedback-red);
  font-size: .78rem;
  font-weight: 800;
}
.mj-feedback-submit {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid #ffb12c;
  border-radius: 15px;
  background: var(--mj-feedback-gold);
  color: #fff;
  font: 900 1rem/1.2 "Cairo", system-ui, sans-serif;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
  box-shadow: 0 4px 0 #a96600;
  cursor: pointer;
}
.mj-feedback-submit:active { transform: translateY(3px); box-shadow: 0 1px 0 #a96600; }
.mj-feedback-submit:disabled { opacity: .58; cursor: wait; }
.mj-feedback-submit svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.mj-feedback-success {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--mj-feedback-green);
  text-align: center;
}
/* Focused only so screen readers announce the confirmation. */
.mj-feedback-success:focus { outline: none; }
.mj-feedback-success[hidden],
.mj-feedback-form[hidden] { display: none; }
.mj-feedback-success svg { width: 62px; height: 62px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mj-feedback-success strong { color: var(--mj-feedback-ink); font-size: 1.35rem; }


/* ── Host: private management board ────────────────────────────────────── */
.mj-feedback-admin-entry .mj-feedback-mark {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}
#mj-feedback-board {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% -12%, rgba(229, 141, 0, .15), transparent 34%),
    #071523;
  color: var(--mj-feedback-ink);
}
#mj-feedback-board.open { display: flex; flex-direction: column; }
.mj-feedback-board-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) clamp(14px, 3vw, 34px) 12px;
  border-bottom: 1px solid var(--mj-feedback-line);
  background: rgba(7, 21, 35, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.mj-feedback-board-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  color: #f3a51a;
}
.mj-feedback-board-title h2 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.12rem, 2.5vw, 1.5rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mj-feedback-board-back,
.mj-feedback-board-refresh {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .76);
  box-shadow: none;
}
.mj-feedback-board-back svg,
.mj-feedback-board-refresh svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mj-feedback-board-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  overflow-x: auto;
  scrollbar-width: none;
}
.mj-feedback-board-tools::-webkit-scrollbar { display: none; }
.mj-feedback-search {
  flex: 1 0 min(270px, 70vw);
  min-width: 180px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 14px;
  outline: 0;
  background: rgba(255, 255, 255, .055);
  color: #fff;
  font: 700 .92rem/1 "Cairo", system-ui, sans-serif;
}
.mj-feedback-search::placeholder { color: rgba(255, 255, 255, .38); }
.mj-feedback-filter {
  flex: 0 0 auto;
  min-width: 46px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .56);
  box-shadow: none;
  font: 800 .76rem/1 "Cairo", system-ui, sans-serif;
}
.mj-feedback-filter svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mj-feedback-filter.is-active {
  border-color: rgba(229, 141, 0, .66);
  background: var(--mj-feedback-gold-soft);
  color: #f3a51a;
}
.mj-feedback-filter-count {
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  color: currentColor;
  font: 800 .68rem/1 system-ui, sans-serif;
}
.mj-feedback-board-list {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  padding: 18px clamp(14px, 3vw, 34px) calc(30px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
}
.mj-feedback-empty {
  grid-column: 1 / -1;
  min-height: 44vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .43);
  font-weight: 800;
  text-align: center;
}
.mj-feedback-empty .mj-feedback-mark { width: 48px; height: 48px; opacity: .56; }
.mj-feedback-load-more {
  grid-column: 1 / -1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  justify-self: center;
  padding: 0;
  border: 1px solid rgba(229, 141, 0, .42);
  border-radius: 16px;
  background: var(--mj-feedback-gold-soft);
  color: #f3a51a;
  box-shadow: none;
}
.mj-feedback-load-more svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mj-feedback-load-more:disabled { opacity: .5; cursor: wait; }
.mj-feedback-card {
  min-width: 0;
  align-self: start;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.mj-feedback-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.mj-feedback-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(229, 141, 0, .28);
  border-radius: 15px;
  background: rgba(229, 141, 0, .08);
  color: #f3a51a;
  font-size: 1.25rem;
}
.mj-feedback-avatar img { width: 100%; height: 100%; object-fit: contain; }
.mj-feedback-person-meta { min-width: 0; }
.mj-feedback-person-meta strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: .98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mj-feedback-person-meta span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: rgba(255, 255, 255, .43);
  font-size: .72rem;
  direction: ltr;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mj-feedback-category-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: #f3a51a;
}
.mj-feedback-category-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mj-feedback-card-body { padding: 14px; }
.mj-feedback-copy {
  min-height: 58px;
  margin: 0 0 12px;
  color: rgba(255, 255, 255, .92);
  font-size: .96rem;
  font-weight: 700;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mj-feedback-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.mj-feedback-context span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  color: rgba(255, 255, 255, .43);
  font-size: .68rem;
  font-weight: 800;
}
.mj-feedback-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  gap: 8px;
  margin-bottom: 9px;
}
.mj-feedback-status,
.mj-feedback-note {
  width: 100%;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 12px;
  outline: 0;
  background: #0b1d31;
  color: #fff;
  font: 700 .82rem/1.4 "Cairo", system-ui, sans-serif;
}
.mj-feedback-status { height: 44px; padding: 0 10px; }
.mj-feedback-note { min-height: 68px; resize: vertical; padding: 10px 11px; }
.mj-feedback-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: 8px;
}
.mj-feedback-icon-action {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--mj-feedback-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .58);
  box-shadow: none;
}
.mj-feedback-icon-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mj-feedback-icon-action.is-contacted { border-color: rgba(69, 197, 138, .48); background: rgba(69, 197, 138, .1); color: var(--mj-feedback-green); }
.mj-feedback-icon-action.is-save { color: #f3a51a; }
.mj-feedback-board-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 1270;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(9, 28, 47, .95);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  font-size: .8rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.mj-feedback-board-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* New surfaces understand the optional cream appearance independently. */

@media (min-width: 680px) {
  .mj-feedback-sheet {
    width: min(520px, calc(100vw - 32px));
    border-bottom: 1px solid var(--mj-feedback-line);
    border-radius: 24px;
  }
}
@media (max-width: 560px) {
  .mj-feedback-board-top { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .mj-feedback-board-title .mj-feedback-mark { display: none; }
  .mj-feedback-board-tools { gap: 8px; }
  .mj-feedback-filter { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .mj-feedback-entry,
  .mj-feedback-close { transition: none; }
}
