.feedback-entry {
  --feedback-edge: max(20px, env(safe-area-inset-right));
  --feedback-bottom: calc(var(--game-bottom-controls-height, 76px) + 12px + env(safe-area-inset-bottom));
  --feedback-wheel-width: 90px;
  --feedback-wheel-space: 128px;
  position: fixed;
  right: calc(var(--feedback-edge) + var(--feedback-wheel-width) + 12px);
  bottom: var(--feedback-bottom);
  z-index: 100100;
  font: inherit;
}

.feedback-launcher {
  display: block;
  min-width: 64px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #ef4444;
  border-radius: 24px;
  color: #fff;
  background: #dc2626;
  font: inherit;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 3px 10px rgba(127, 29, 29, .28);
  transition: background .15s ease, box-shadow .15s ease;
}

.feedback-launcher:hover { background: #b91c1c; box-shadow: 0 4px 14px rgba(127, 29, 29, .36); }
.feedback-launcher:focus-visible { outline: 3px solid #fcd34d; outline-offset: 3px; }

.feedback-card {
  position: fixed;
  right: var(--feedback-edge);
  bottom: calc(var(--feedback-bottom) + var(--feedback-wheel-space) + 12px);
  width: 304px;
  max-width: calc(100vw - var(--feedback-edge) - max(12px, env(safe-area-inset-left)));
  max-height: calc(100vh - var(--feedback-bottom) - var(--feedback-wheel-space) - 12px - max(12px, env(safe-area-inset-top)));
  max-height: calc(100dvh - var(--feedback-bottom) - var(--feedback-wheel-space) - 12px - max(12px, env(safe-area-inset-top)));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  color: #1f2937;
  background: #fff;
  box-shadow: 0 12px 36px rgba(11, 29, 49, .24);
}

.feedback-card[hidden] { display: none; }

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.feedback-title { font-size: 17px; line-height: 1.5; font-weight: 600; }
.feedback-close { flex: none; width: 44px; height: 44px; border-radius: 6px; color: #64748b; font-size: 26px; line-height: 1; }
.feedback-close:hover { color: #1f2937; background: #f3f4f6; }
.feedback-body { padding: 14px 16px 12px; }
.feedback-invitation { margin: 0 0 14px; color: #4b5563; font-size: 14px; line-height: 1.7; }

.feedback-join {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  color: #fff;
  background: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.feedback-join:hover { background: #1d4ed8; border-color: #1d4ed8; }
.feedback-group { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; margin-top: 12px; }
.feedback-group-label { color: #64748b; font-size: 12px; line-height: 1.7; }
.feedback-group-number { color: #1f2937; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; user-select: text; -webkit-user-select: text; cursor: text; }
.feedback-copy { min-height: 44px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; color: #374151; background: #f9fafb; font: inherit; font-size: 12px; }
.feedback-copy:hover { background: #f3f4f6; }
.feedback-copy:disabled { opacity: .6; cursor: wait; }
.feedback-status { min-height: 3em; margin: 8px 0 0; color: #4b5563; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.feedback-card button:focus-visible, .feedback-card a:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }

@media (max-width: 768px) {
  .feedback-entry {
    --feedback-edge: max(12px, env(safe-area-inset-right));
    --feedback-wheel-width: 72px;
    --feedback-wheel-space: 112px;
  }
}

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