/* Inline English translations for game instructions */

.instruction-en {
  display: block;
  margin-top: 4px;
  font-style: italic;
  font-size: .95em;
  color: #7f8ea8;
  line-height: 1.55;
}

/* Feedback launcher + slide-out drawer */

.feedback-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #06121f;
  font-family: inherit;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 12px 30px -12px rgba(34, 211, 238, .9);
  transition: filter .15s, transform .15s;
}

.feedback-launcher:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.feedback-launcher:active {
  transform: translateY(0) scale(.98);
}

.feedback-launcher:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 3px;
}

.feedback-launcher svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.feedback-root {
  position: fixed;
  inset: 0;
  z-index: 4000;
  pointer-events: none;
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, .74);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transition: opacity .25s ease, visibility .25s ease;
}

.feedback-root.is-open .feedback-backdrop {
  opacity: 1;
  visibility: visible;
}

.feedback-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  height: 100%;
  overflow-y: auto;
  background: rgba(15, 23, 42, .99);
  border-left: 1px solid rgba(255, 255, 255, .12);
  box-shadow: -30px 0 80px -24px #000;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: auto;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1), visibility .3s ease;
}

.feedback-root.is-open .feedback-drawer {
  transform: none;
  visibility: visible;
}

.feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 22px 0;
}

.feedback-header h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  color: #f8fafc;
}

.feedback-header p {
  margin-top: 6px;
  color: #94a3b8;
  font-size: .84rem;
  line-height: 1.55;
}

.feedback-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.feedback-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-lang {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: #cbd5e1;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.feedback-lang:hover {
  background: rgba(255, 255, 255, .14);
  color: #f8fafc;
}

.feedback-lang:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
}

.feedback-close:hover {
  background: rgba(255, 255, 255, .14);
  color: #f8fafc;
}

.feedback-close:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
}

#feedbackForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 28px;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-field label {
  color: #cbd5e1;
  font-size: .78rem;
  font-weight: 700;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: #e2e8f0;
  font-family: inherit;
  font-size: .92rem;
  line-height: 1.45;
}

.feedback-field textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-field select option {
  background: #111827;
  color: #e2e8f0;
}

.feedback-field input::placeholder,
.feedback-field textarea::placeholder {
  color: #64748b;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
  outline: 2px solid rgba(34, 211, 238, .65);
  outline-offset: 1px;
  border-color: rgba(34, 211, 238, .7);
}

.feedback-field input[aria-invalid="true"],
.feedback-field select[aria-invalid="true"],
.feedback-field textarea[aria-invalid="true"] {
  border-color: #f87171;
}

.feedback-field-error {
  color: #fca5a5;
  font-size: .72rem;
  line-height: 1.45;
}

.feedback-field-error:empty {
  display: none;
}

.feedback-submit {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #06121f;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(34, 211, 238, .9);
  transition: filter .15s, transform .15s;
}

.feedback-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.feedback-submit:active:not(:disabled) {
  transform: translateY(0) scale(.99);
}

.feedback-submit:disabled {
  opacity: .65;
  cursor: wait;
  box-shadow: none;
}

.feedback-status {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .82rem;
  line-height: 1.5;
}

.feedback-status:not(:empty) {
  display: block;
}

.feedback-success {
  border: 1px solid rgba(52, 211, 153, .4);
  background: rgba(52, 211, 153, .12);
  color: #a7f3d0;
}

.feedback-error {
  border: 1px solid rgba(248, 113, 113, .4);
  background: rgba(248, 113, 113, .12);
  color: #fecaca;
}

.feedback-hint {
  color: #64748b;
  font-size: .7rem;
  line-height: 1.5;
}

@media (max-width: 520px) {
  /* Reserve space at the bottom of the page so the floating Feedback
     button never covers the answers or the submit / next buttons. */
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .feedback-launcher {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }

  .feedback-launcher span {
    display: none;
  }

  .feedback-launcher svg {
    width: 20px;
    height: 20px;
  }

  .feedback-header {
    padding: 20px 18px 0;
  }

  #feedbackForm {
    padding: 18px 18px 24px;
  }
}
