:root {
  --playtest-ink: #24313a;
  --playtest-paper: #f2ead8;
  --playtest-green: #173b33;
  --playtest-brass: #c9a665;
  --playtest-line: rgba(36, 49, 58, 0.2);
}

.playtest-feedback-tab {
  position: fixed;
  z-index: 1000;
  right: 0;
  top: 46%;
  width: 34px;
  min-height: 66px;
  padding: 10px 8px;
  border: 1px solid rgba(233, 194, 126, 0.55);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: #fff1d2;
  background: rgba(23, 59, 51, 0.94);
  box-shadow: 0 3px 12px rgba(13, 29, 25, 0.24);
  font: 600 13px/1.15 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  cursor: pointer;
  touch-action: manipulation;
}

.playtest-feedback-tab:focus-visible,
.playtest-close:focus-visible,
.playtest-submit:focus-visible,
.playtest-secondary:focus-visible,
.playtest-choice-row label:has(input:focus-visible) {
  outline: 3px solid rgba(233, 194, 126, 0.72);
  outline-offset: 2px;
}

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

.playtest-feedback-layer {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  color: var(--playtest-ink);
  background: rgba(12, 24, 21, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  user-select: text;
  -webkit-user-select: text;
}

.playtest-feedback-sheet {
  width: min(100%, 430px);
  max-height: min(690px, calc(100dvh - 32px));
  overflow: auto;
  padding: 24px 22px 20px;
  border: 1px solid rgba(201, 166, 101, 0.72);
  border-radius: 12px 12px 8px 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
    var(--playtest-paper);
  box-shadow: 0 18px 48px rgba(6, 20, 16, 0.38);
  text-align: left;
  box-sizing: border-box;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.playtest-feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--playtest-line);
}

.playtest-feedback-kicker {
  margin: 0 0 4px;
  color: #6f5b39;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

.playtest-feedback-header h1 {
  margin: 0;
  color: var(--playtest-ink);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.playtest-close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #5b665f;
  background: transparent;
  font: 300 30px/30px Arial, sans-serif;
  cursor: pointer;
}

.playtest-feedback-sheet form {
  padding-top: 18px;
}

.playtest-feedback-sheet fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.playtest-feedback-sheet legend,
.playtest-field > span {
  display: block;
  margin: 0 0 8px;
  color: #44514b;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.playtest-choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(36, 49, 58, 0.25);
  border-radius: 6px;
  overflow: hidden;
}

.playtest-choice-row label {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 5px;
  color: #46524c;
  background: rgba(255, 255, 255, 0.24);
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}

.playtest-choice-row label + label {
  border-left: 1px solid rgba(36, 49, 58, 0.2);
}

.playtest-choice-row label:has(input:checked) {
  color: #fff3d6;
  background: var(--playtest-green);
}

.playtest-choice-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.playtest-field {
  display: block;
  margin: 0 0 16px;
}

.playtest-field select,
.playtest-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(36, 49, 58, 0.28);
  border-radius: 5px;
  color: var(--playtest-ink);
  background: rgba(255, 255, 255, 0.44);
  box-sizing: border-box;
  font: 400 15px/1.45 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  user-select: text;
  -webkit-user-select: text;
}

.playtest-field textarea {
  resize: vertical;
}

.playtest-privacy,
.playtest-status {
  margin: 0;
  color: #69736d;
  font-size: 12px;
  line-height: 1.55;
}

.playtest-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin: 17px 0 10px;
}

.playtest-submit,
.playtest-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 5px;
  font: 650 15px/1.3 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.playtest-submit {
  border: 1px solid #173b33;
  color: #fff2d2;
  background: #173b33;
}

.playtest-secondary {
  border: 1px solid rgba(36, 49, 58, 0.34);
  color: #34423b;
  background: transparent;
}

.playtest-status {
  min-height: 19px;
  color: #315f50;
}

@media (min-width: 760px) {
  .playtest-feedback-layer {
    align-items: center;
  }

  .playtest-feedback-sheet {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .playtest-feedback-layer:not([hidden]) .playtest-feedback-sheet {
    animation: playtest-sheet-in 180ms ease-out both;
  }
}

@keyframes playtest-sheet-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
