.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 24px);
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(7px);
}

.feedback-hidden { display: none !important; }
.feedback-dialog-open { overflow: hidden; }

.feedback-dialog {
  width: min(476px, 100%);
  max-height: calc(100dvh - clamp(20px, 6vh, 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #dbeafe;
  background: #0f172a;
  border: 1px solid rgba(96, 165, 250, .34);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, .62);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.feedback-header,
.feedback-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #111c32;
}

.feedback-header { flex: 0 0 auto; justify-content: space-between; border-bottom: 1px solid rgba(96, 165, 250, .2); }
.feedback-header h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: #f8fafc; font-size: 18px; line-height: 1.25; }
.feedback-header h2 svg { width: 21px; height: 21px; fill: #f59e0b; flex: 0 0 auto; }
.feedback-close { width: 36px; height: 36px; border: 1px solid transparent; border-radius: 9px; color: #9db0cf; background: transparent; font-size: 25px; line-height: 1; cursor: pointer; }
.feedback-close:hover { border-color: rgba(96, 165, 250, .28); color: #f8fafc; background: #182541; }

.feedback-form { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.feedback-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 8px; scrollbar-color: rgba(56, 189, 248, .62) #0b1220; }
.feedback-body::-webkit-scrollbar { width: 9px; }
.feedback-body::-webkit-scrollbar-track { background: #0b1220; }
.feedback-body::-webkit-scrollbar-thumb { border: 2px solid #0b1220; border-radius: 999px; background: rgba(56, 189, 248, .62); }
.feedback-game { display: flex; align-items: center; gap: 12px; padding: 11px; margin-bottom: 18px; border: 1px solid rgba(96, 165, 250, .28); border-radius: 12px; background: #111e35; }
.feedback-game-cover { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #1e293b; }
.feedback-game-copy { min-width: 0; display: grid; gap: 2px; }
.feedback-game-copy > span { color: #8ba4c7; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.feedback-game-copy strong, .feedback-game-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-game-copy strong { color: #f8fafc; font-size: 15px; }
.feedback-game-copy small { color: #9db0cf; font-size: 12px; }

.feedback-fieldset { min-width: 0; padding: 0; margin: 0 0 18px; border: 0; }
.feedback-fieldset legend, .feedback-field > span { display: block; margin-bottom: 9px; color: #cbdaf0; font-size: 13px; font-weight: 700; }
.feedback-fieldset legend span { color: #67e8f9; }
.feedback-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.feedback-choice { position: relative; display: flex; min-height: 46px; align-items: center; padding: 10px 11px; border: 1px solid rgba(96, 165, 250, .22); border-radius: 10px; color: #c3d2e8; background: #111c30; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.feedback-choice:hover { border-color: rgba(56, 189, 248, .68); background: #142440; }
.feedback-choice input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.feedback-choice span { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.25; }
.feedback-choice span::before { width: 13px; height: 13px; flex: 0 0 auto; border: 1.5px solid #8296b6; border-radius: 50%; content: ""; box-shadow: inset 0 0 0 3px #111c30; }
.feedback-choice:has(input:checked) { border-color: #38bdf8; color: #dff7ff; background: #102b4b; }
.feedback-choice:has(input:checked) span::before { border-color: #38bdf8; background: #38bdf8; }
.feedback-choice:has(input:focus-visible) { outline: 3px solid rgba(56, 189, 248, .28); outline-offset: 2px; }
.feedback-field { display: block; position: relative; margin-bottom: 17px; }
.feedback-field textarea, .feedback-field input { box-sizing: border-box; width: 100%; border: 1px solid rgba(96, 165, 250, .28); border-radius: 10px; color: #e5efff; background: #0b1220; font: inherit; font-size: 14px; outline: 0; }
.feedback-field textarea::placeholder, .feedback-field input::placeholder { color: #7185a5; }
.feedback-field textarea { min-height: 92px; resize: vertical; padding: 11px 12px 25px; }
.feedback-field input { height: 44px; padding: 0 12px; }
.feedback-field textarea:focus, .feedback-field input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .14); }
.feedback-field > small { position: absolute; right: 10px; bottom: 8px; color: #8296b6; font-size: 11px; }
.feedback-turnstile { min-height: 65px; margin: 0 0 14px; }
.feedback-status { min-height: 20px; margin: 0 0 8px; font-size: 13px; line-height: 1.4; }
.feedback-status[data-state="error"] { color: #fca5a5; }
.feedback-status[data-state="success"] { color: #86efac; font-weight: 700; }
.feedback-status[data-state="loading"] { color: #93c5fd; }

.feedback-footer { flex: 0 0 auto; justify-content: flex-end; border-top: 1px solid rgba(96, 165, 250, .2); }
.feedback-button { min-height: 42px; padding: 0 17px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.feedback-button--secondary { border: 1px solid rgba(96, 165, 250, .34); color: #cbdaf0; background: #182541; }
.feedback-button--secondary:hover:not(:disabled) { border-color: rgba(56, 189, 248, .7); color: #f8fafc; background: #213252; }
.feedback-button--primary { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(165, 180, 252, .7); color: #fff; background: #4f46e5; box-shadow: 0 7px 16px rgba(49, 46, 129, .35); }
.feedback-button:hover:not(:disabled) { transform: translateY(-1px); }
.feedback-button--primary:hover:not(:disabled) { background: #5b55ee; }
.feedback-button:focus-visible, .feedback-close:focus-visible { outline: 3px solid rgba(56, 189, 248, .4); outline-offset: 2px; }
.feedback-button:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.feedback-spinner { display: none; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: feedback-spin .7s linear infinite; }
.feedback-dialog.is-submitting .feedback-spinner { display: block; }

@keyframes feedback-spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .feedback-overlay { align-items: end; padding: 10px; }
  .feedback-dialog { max-height: calc(100dvh - 20px); border-radius: 16px; }
  .feedback-header, .feedback-footer { padding: 13px 14px; }
  .feedback-body { padding: 14px 14px 6px; }
  .feedback-choice-grid { grid-template-columns: 1fr; }
  .feedback-choice { min-height: 44px; }
  .feedback-footer .feedback-button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-choice, .feedback-button { transition: none; }
  .feedback-spinner { animation-duration: 1.4s; }
}
