/* Feedback entry button + the app's sheets for feedback (feedback-sheet.js).
   Loaded after light-theme.css so both appearances match the other in-app
   icon buttons and the Settings sheet, which keep one palette too. */

/* ── Entry: the same rounded-square icon button as the discovery screen's
   back/settings buttons (game-discovery.css .discovery-icon-button). ───── */
.mj-feedback-link {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  min-height: 48px;
  margin-top: 12px;
  padding: 0;
  border: 2px solid #052637;
  border-radius: 15px;
  background: #03476b;
  color: #fff7e8;
  box-shadow: 0 4px 8px rgba(0, 35, 55, 0.4);
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: transform 140ms cubic-bezier(0.2, 0.9, 0.3, 1), background-color 140ms linear, box-shadow 140ms linear;
}
/* Speech bubble with writing lines; keep the existing link name accessible. */
.mj-feedback-link::before {
  content: "";
  width: 25px;
  height: 25px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11.5a8 8 0 0 1-8 8H4l-2 2v-10a9 9 0 0 1 18 0Z'/%3E%3Cpath d='M7 9h8M7 13h5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11.5a8 8 0 0 1-8 8H4l-2 2v-10a9 9 0 0 1 18 0Z'/%3E%3Cpath d='M7 9h8M7 13h5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.mj-feedback-link :is(strong, span) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mj-feedback-link:active {
  transform: scale(0.92);
  background: #023a58;
  box-shadow: 0 2px 4px rgba(0, 35, 55, 0.4);
}
@media (hover: hover) {
  .mj-feedback-link:hover { background: #075379; }
}
.mj-feedback-link:focus-visible { outline: 3px solid #f3a400; outline-offset: 3px; }

/* ── Sheet presentation (MJSheet) ─────────────────────────────────────────
   Tokens and motion mirror the approved Settings sheet (settings-phone.css):
   dimmed backdrop only — the screen behind never blurs or moves — and the
   panel rides up from the bottom edge, following the finger when pulled. */
.mj-sheet {
  --st-ink: #f4f1ea;
  --st-ink-muted: rgba(244, 241, 234, 0.62);
  --st-ink-faint: rgba(244, 241, 234, 0.38);
  --st-card-solid: #0b2c40;
  --st-sheet: #0d2d41;
  --st-line: rgba(255, 255, 255, 0.09);
  --st-press: rgba(255, 255, 255, 0.07);
  --st-control: rgba(255, 255, 255, 0.13);
  --st-accent: #f3a400;
  --st-accent-ink: #1a1405;
  --st-danger: #ff7b7b;
  --st-scrim: rgba(1, 12, 20, 0.58);
  --st-r-card: 18px;
  --st-r-control: 12px;
  --st-r-sheet: 24px;
  --st-pad: 16px;
  --st-fs-caption: 13px;
  --st-fs-value: 15px;
  --st-fs-row: 16px;
  --st-fs-title: 20px;
  --st-ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  --st-fast: 140ms;
  --st-base: 260ms;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--st-ink);
  direction: rtl;
  font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}
.mj-sheet[open] { display: flex; align-items: flex-end; justify-content: center; }
.mj-sheet::backdrop { background: transparent; }
.mj-sheet-scrim {
  position: absolute;
  inset: 0;
  background: var(--st-scrim);
  opacity: 0;
  transition: opacity var(--st-base) linear;
  touch-action: none;
}
.mj-sheet.is-presented .mj-sheet-scrim { opacity: 1; }
.mj-sheet.is-closing .mj-sheet-scrim { transition-duration: 220ms; }
.mj-sheet-panel {
  position: relative;
  transform: translateY(105%);
  transition: transform 320ms var(--st-ease);
}
.mj-sheet.is-presented .mj-sheet-panel { transform: translateY(var(--mj-sheet-drag, 0px)); }
.mj-sheet.is-dragging .mj-sheet-panel { transition: none; }
.mj-sheet.is-closing .mj-sheet-panel { transition: transform 220ms cubic-bezier(0.4, 0, 1, 1); }
.mj-sheet-handle {
  width: 36px;
  height: 5px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--st-ink-faint);
}
/* Resets against the screens' global element styles (`button { width: 100% }`,
   host hover lifts). Class weight only, so each sheet's own rules still win. */
.mj-sheet :where(button, input, textarea) {
  width: auto;
  margin: 0;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.mj-sheet :where(button) { cursor: pointer; touch-action: manipulation; }
.mj-sheet :where(button):hover { transform: none; filter: none; }
.mj-sheet :where(h2, h3, p) { margin: 0; }

/* ── Suggestions board sheet ─────────────────────────────────────────────── */
.mj-fs-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  height: min(88vh, 760px);
  height: min(88dvh, 760px);
  box-sizing: border-box;
  overflow: clip;
  border-radius: var(--st-r-sheet) var(--st-r-sheet) 0 0;
  background: var(--st-sheet);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
  text-align: start;
}
.mj-fs-head {
  flex: 0 0 auto;
  padding: 8px var(--st-pad) 6px;
  touch-action: none;
  cursor: grab;
}
.mj-fs-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.mj-fs-title {
  overflow: hidden;
  color: var(--st-ink);
  font: 700 var(--st-fs-title) / 1.4 "IBM Plex Sans Arabic", "Cairo", sans-serif;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mj-sheet .mj-fs-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--st-control);
  color: var(--st-ink);
  box-shadow: none;
  transition: transform var(--st-fast) var(--st-ease), background var(--st-fast) linear;
}
.mj-sheet .mj-fs-icon:active { transform: scale(0.92); background: var(--st-press); }
.mj-fs-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mj-fs-panel[data-view="list"] .mj-fs-back { visibility: hidden; }

.mj-fs-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--st-pad) var(--st-pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mj-fs-panel[data-view="list"] .mj-fs-compose-view,
.mj-fs-panel[data-view="compose"] .mj-fs-list-view { display: none; }
/* Pushed views slide in from the reading direction's forward edge (left). */
.mj-fs-panel[data-nav="push"] .mj-fs-compose-view { animation: mj-fs-push var(--st-base) var(--st-ease) both; }
.mj-fs-panel[data-nav="pop"] .mj-fs-list-view { animation: mj-fs-pop var(--st-base) var(--st-ease) both; }
@keyframes mj-fs-push { from { transform: translateX(-32px); opacity: 0; } }
@keyframes mj-fs-pop { from { transform: translateX(32px); opacity: 0; } }

.mj-sheet .mj-fs-lead {
  margin: 0 0 14px;
  color: var(--st-ink-muted);
  font-size: var(--st-fs-caption);
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}
.mj-fs-segment {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--st-r-control);
  background: var(--st-control);
}
.mj-sheet .mj-fs-segment button {
  flex: 1 1 0;
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--st-ink-muted);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  transition: background var(--st-fast) linear, color var(--st-fast) linear;
}
.mj-sheet .mj-fs-segment button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.22);
  color: var(--st-ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mj-sheet .mj-fs-segment button:active { transform: none; background: var(--st-press); }

.mj-fs-list { display: grid; gap: 10px; margin-top: 14px; }
.mj-fs-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--st-r-card);
  background: var(--st-card-solid);
  box-shadow: inset 0 0 0 1px var(--st-line);
}
.mj-fs-card.is-skeleton {
  min-height: 108px;
  background: linear-gradient(90deg, var(--st-card-solid) 30%, #143a51 50%, var(--st-card-solid) 70%) 0 0 / 220% 100%;
  animation: mj-fs-shimmer 1.3s linear infinite;
}
@keyframes mj-fs-shimmer { to { background-position: -220% 0; } }
.mj-sheet .mj-fs-vote {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  width: 56px;
  min-height: 64px;
  padding: 6px 0;
  border: 0;
  border-radius: 14px;
  background: var(--st-control);
  color: var(--st-ink);
  box-shadow: none;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: transform var(--st-fast) var(--st-ease), background var(--st-fast) linear, color var(--st-fast) linear;
}
.mj-fs-vote svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mj-sheet .mj-fs-vote[aria-pressed="true"] { background: var(--st-accent); color: var(--st-accent-ink); }
.mj-sheet .mj-fs-vote:active { transform: scale(0.93); }
.mj-sheet .mj-fs-vote:disabled { opacity: 1; cursor: default; }
.mj-fs-card-body { min-width: 0; }
.mj-fs-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.mj-fs-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--st-control);
  color: var(--st-ink-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}
.mj-fs-badge.is-feature { background: rgba(243, 164, 0, 0.16); color: #ffc85a; }
.mj-fs-badge.is-bug { background: rgba(255, 123, 123, 0.16); color: #ff9c9c; }
.mj-fs-badge.is-planned { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.mj-fs-badge.is-in_progress { background: rgba(96, 165, 250, 0.18); color: #9cc8ff; }
.mj-fs-badge.is-shipped { background: rgba(69, 197, 138, 0.18); color: #7fe0b2; }
.mj-fs-card h3 {
  margin: 8px 0 4px;
  color: var(--st-ink);
  font-size: var(--st-fs-row);
  font-weight: 700;
  line-height: 1.5;
}
.mj-fs-details {
  display: -webkit-box;
  overflow: hidden;
  color: var(--st-ink-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.mj-sheet .mj-fs-notify {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--st-ink-muted);
  box-shadow: none;
  font-size: var(--st-fs-caption);
  font-weight: 700;
}
.mj-sheet .mj-fs-notify:active { color: var(--st-ink); transform: none; }
.mj-fs-notify svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mj-fs-subscribe { display: flex; gap: 8px; margin-top: 6px; }
.mj-sheet .mj-fs-subscribe input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-control);
  background: rgba(255, 255, 255, 0.06);
  color: var(--st-ink);
  direction: ltr;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
.mj-sheet .mj-fs-subscribe button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--st-r-control);
  background: var(--st-accent);
  color: var(--st-accent-ink);
  box-shadow: none;
  font-size: var(--st-fs-value);
  font-weight: 800;
}

.mj-fs-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 12px;
  text-align: center;
}
.mj-fs-empty-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--st-control);
  color: var(--st-ink-muted);
}
.mj-fs-empty-mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mj-fs-empty strong { color: var(--st-ink); font-size: 17px; font-weight: 700; }
.mj-fs-empty p { color: var(--st-ink-muted); font-size: 14px; line-height: 1.7; }
.mj-sheet .mj-fs-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--st-control);
  color: var(--st-ink);
  box-shadow: none;
  font-size: var(--st-fs-value);
  font-weight: 700;
}
.mj-fs-secondary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.mj-fs-compose-view { padding-top: 4px; }
.mj-fs-field { display: grid; gap: 6px; margin-top: 16px; }
.mj-fs-field > span { color: var(--st-ink-muted); font-size: var(--st-fs-caption); font-weight: 700; }
.mj-sheet .mj-fs-field :is(input, textarea) {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-control);
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--st-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  text-align: right;
  transition: border-color var(--st-fast) linear, background var(--st-fast) linear;
}
.mj-sheet .mj-fs-field textarea { min-height: 150px; resize: none; }
.mj-sheet .mj-fs-field :is(input, textarea):focus { border-color: rgba(243, 164, 0, 0.75); background: rgba(255, 255, 255, 0.09); }
.mj-sheet .mj-fs-field :is(input, textarea)::placeholder { color: var(--st-ink-faint); font-weight: 500; }
.mj-fs-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mj-sheet .mj-fs-error { min-height: 22px; margin-top: 10px; color: var(--st-danger); font-size: var(--st-fs-caption); font-weight: 700; }

.mj-fs-foot {
  flex: 0 0 auto;
  padding: 10px var(--st-pad) calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--st-line);
  background: var(--st-sheet);
}
.mj-sheet .mj-fs-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--st-r-card);
  background: var(--st-accent);
  color: var(--st-accent-ink);
  box-shadow: none;
  font-size: 17px;
  font-weight: 800;
  transition: transform var(--st-fast) var(--st-ease), filter var(--st-fast) linear;
}
.mj-sheet .mj-fs-primary:active { transform: scale(0.98); filter: brightness(0.94); }
.mj-sheet .mj-fs-primary:disabled { opacity: 0.55; cursor: wait; }
.mj-fs-primary-icon { display: grid; }
.mj-fs-primary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.mj-fs-toast {
  position: absolute;
  inset-inline: 24px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  width: fit-content;
  max-width: calc(100% - 48px);
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.96);
  color: #0d2d41;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--st-fast) linear, transform var(--st-base) var(--st-ease);
  pointer-events: none;
}
.mj-fs-toast.show { opacity: 1; transform: none; }

/* iPad and desktop: a centred form sheet, still rising from below. */
@media (min-width: 700px) and (min-height: 560px) {
  .mj-sheet[open] { align-items: center; }
  .mj-sheet-panel { transform: translateY(calc(50vh + 55%)); }
  .mj-fs-panel {
    height: min(82vh, 720px);
    border-radius: var(--st-r-sheet);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
  .mj-fs-head { cursor: default; }
  .mj-fs-head .mj-sheet-handle { visibility: hidden; height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mj-sheet-scrim,
  .mj-sheet-panel,
  .mj-sheet .mj-sheet-panel,
  .mj-fs-toast { transition: none !important; }
  .mj-fs-panel .mj-fs-view,
  .mj-fs-card.is-skeleton { animation: none !important; }
  .mj-feedback-link { transition: none; }
}
