/* Feedback on the game pages and the games' start pages (static/feedback/js/feedback.js).
   The games have dark and light looks of their own: the inline parts take the page's colour and font and add
   only translucent greys; the dialog is a plain light card over the game. */

/* ── «Как вам партия?» on a game-over screen ─────────────────────────────── */
.fb-rate {
  margin: 18px auto 6px; padding: 14px 12px 12px; max-width: 420px; width: calc(100% - 24px); box-sizing: border-box;
  border: 1px solid rgba(127, 127, 127, 0.32); border-radius: 18px; background: rgba(127, 127, 127, 0.08);
  text-align: center; color: inherit; font: inherit;
}
.fb-rate.fb-plain { margin: 0; padding: 0; width: auto; max-width: none; border: 0; background: none; }   /* inside a page's own card */
.fb-rate-q { margin: 0 0 10px; font-weight: 700; font-size: 1.05em; }
.fb-rate-faces { display: flex; justify-content: center; gap: 6px; flex-wrap: nowrap; }
.fb-face {
  flex: 1 1 0; max-width: 60px; min-width: 44px; height: 52px; padding: 0; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(127, 127, 127, 0.32); background: rgba(127, 127, 127, 0.1);
  font-size: 28px; line-height: 1; color: inherit; transition: transform .12s, background-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.fb-face:hover { background: rgba(127, 127, 127, 0.2); }
.fb-face:active { transform: scale(0.94); }
.fb-face[aria-pressed="true"] { background: rgba(127, 127, 127, 0.28); border-color: currentColor; transform: scale(1.06); }
.fb-face:focus-visible, .fb-btn:focus-visible, .fb-input:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.fb-rate-more { margin-top: 12px; text-align: left; }
.fb-rate-more[hidden] { display: none; }
.fb-rate-label { display: block; font-weight: 700; font-size: .92em; margin-bottom: 6px; }
.fb-rate-label span { font-weight: 500; opacity: .7; }
.fb-rate-row { display: flex; gap: 8px; }
.fb-input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid rgba(127, 127, 127, 0.4); border-radius: 12px; background: rgba(127, 127, 127, 0.1);
  color: inherit; font: inherit; font-size: 16px;   /* 16px: phones do not zoom in */
}
.fb-input::placeholder { color: inherit; opacity: .55; }
.fb-btn {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(127, 127, 127, 0.45); background: rgba(127, 127, 127, 0.24);
  color: inherit; font: inherit; font-weight: 700; font-size: 15px;
}
.fb-btn[disabled] { opacity: .5; cursor: default; }
.fb-rate-status { margin: 8px 0 0; min-height: 1.2em; font-size: .9em; opacity: .85; }
.fb-rate-status:empty { margin: 0; min-height: 0; }

/* ── «Сообщить о проблеме»: a quiet link at the foot of a game page ─────────── */
.fb-foot { text-align: center; padding: 14px 16px 18px; }
.fb-problem {
  color: inherit; opacity: .62; font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
  display: inline-block; padding: 8px 4px; min-height: 24px;
}
.fb-problem:hover, .fb-problem:focus-visible { opacity: 1; }

/* ── The dialog over the game ───────────────────────────────────────────── */
.fb-dialog {
  position: fixed; inset: 0; margin: auto;     /* the games reset margins: centre it again */
  width: min(440px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 32px); box-sizing: border-box;
  overflow-y: auto;
  padding: 22px; border: 0; border-radius: 22px; background: #fff; color: #1e1a3a;
  box-shadow: 0 20px 60px rgba(20, 18, 40, 0.35);
  font: 500 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; text-align: left;
}
.fb-dialog::backdrop { background: rgba(20, 18, 40, 0.55); }
.fb-dialog [hidden] { display: none !important; }
.fb-dialog-title { margin: 0 0 6px; font-size: 21px; font-weight: 800; line-height: 1.2; }
.fb-dialog-lead { margin: 0 0 14px; color: #5b5778; font-size: 15px; }
.fb-dialog-label { display: block; margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.fb-dialog-label span { font-weight: 500; color: #5b5778; }
.fb-dialog-input {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 11px 12px;
  border: 1px solid rgba(30, 26, 58, 0.18); border-radius: 12px; background: #f6f4ff; color: #1e1a3a;
  font: inherit; font-size: 16px; resize: vertical;
}
.fb-dialog-input:focus { outline: none; border-color: #5b3df5; box-shadow: 0 0 0 3px #ebe6ff; }
.fb-dialog-status { margin: 0 0 10px; color: #c62f3f; font-size: 14px; font-weight: 600; }
.fb-dialog-status:empty { display: none; }
.fb-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
.fb-dialog-btn {
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; cursor: pointer;
  background: #5b3df5; color: #fff; font: inherit; font-weight: 700;
}
.fb-dialog-btn.ghost { background: #fff; color: #1e1a3a; border: 1px solid rgba(30, 26, 58, 0.18); }
.fb-dialog-btn[disabled] { opacity: .5; cursor: default; }
.fb-dialog-btn:focus-visible { outline: 3px solid #5b3df5; outline-offset: 2px; }
.fb-dialog-done .fb-dialog-btn { width: 100%; }
.fb-dialog-tg { display: block; margin: 14px 0 0; text-align: center; color: #5d587a; font-size: 15px; }
.fb-dialog-tg a { color: #5b3df5; font-weight: 600; }

.fb-trap {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important;
  overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none;
}

/* ── «Предложить идею» on a game's start page ───────────────────────────── */
/* The room under it keeps the line clear of the corner buttons some start pages pin there (rules, the time chip). */
.fb-idea { margin: 18px auto 0; padding-bottom: 64px; text-align: center; max-width: 420px; color: inherit; }
.fb-idea a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.4); background: rgba(127, 127, 127, 0.1);
  color: inherit; font-weight: 700; text-decoration: none;
}
.fb-idea a:hover { background: rgba(127, 127, 127, 0.2); }
.fb-idea p { margin: 6px 0 0; font-size: 13px; opacity: .72; }

@media (prefers-reduced-motion: reduce) {
  .fb-face { transition: none; }
}
