:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --ink: #222b30;
  --muted: #4b585b;
  --line: #c9c9c0;
  --active: #294953;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
.mast, main { width: min(100% - 36px, 780px); margin: 0 auto; }
.mast { display: flex; gap: 14px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.mark { color: var(--ink); font: 2rem/1 Georgia, serif; }
main { padding: clamp(22px, 5vw, 54px) 0 48px; }
h1, h2, p { margin: 0 0 1rem; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; max-width: 22ch; }
h1:focus { outline: none; }
h2 { font-size: 1.6rem; line-height: 1.22; }
p { max-width: 64ch; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ad6239; outline-offset: 3px; }
button.primary { padding: 11px 24px; min-height: 46px; border: 0; border-radius: 5px; color: white; background: var(--active); font-weight: 550; }
button:disabled { cursor: wait; opacity: .65; }
.frame { font-size: .88rem; color: var(--muted); }
.stack { display: grid; gap: 18px; max-width: 660px; }
.field { display: grid; gap: 6px; }
fieldset { margin: 0; padding: 0; border: none; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
input[type=number], input[type=text], textarea { border: 1px solid #829094; border-radius: 4px; color: var(--ink); background: #fffefa; padding: 9px 12px; max-width: 100%; }
input[type=number] { width: 7rem; }
input[type=text] { width: 16rem; letter-spacing: .12em; }
input[type=radio], input[type=checkbox], input[type=range] { accent-color: var(--active); }
.consent { display: flex; align-items: flex-start; gap: 10px; }
.consent input { margin: 5px 0 0; min-width: 18px; height: 18px; }
.choice { display: inline-flex; align-items: center; gap: 5px; min-height: 42px; margin-right: 15px; }
.actions { margin-top: 18px; }
.primary + .frame { margin-top: 8px; }
#responsePad, .digit-field { width: 100%; min-height: min(42vh, 300px); display: grid; place-content: center; position: relative; border: 1px solid var(--line); border-radius: 8px; background: #fcfbf6; color: var(--ink); }
#responsePad { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#responsePad::after, #pressReceipt { position: absolute; bottom: 12px; inset-inline: 0; text-align: center; color: var(--muted); font-size: .9rem; }
#responsePad::after { content: 'Пробел или нажатие на это поле'; }
#responsePad[data-pressed] { border-color: var(--active); box-shadow: inset 0 0 0 1px var(--active); }
#responsePad[data-pressed]::after { content: none; }
#pressReceipt { color: var(--active); font-weight: 600; pointer-events: none; }
#stimulus, #spanDigit { font-family: system-ui,sans-serif; font-variant-numeric: tabular-nums; line-height: 1; }
#stimulus.mask { font-size: 40px !important; opacity: .55; }
#spanDigit { font-size: 4rem; }
.survey-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.survey-item legend { float: left; width: 100%; margin-bottom: 9px; }
.scale { clear: both; display: grid; gap: 4px; grid-template-columns: repeat(7,minmax(0,1fr)); max-width: 420px; }
.scale label { position: relative; text-align: center; cursor: pointer; }
.scale input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scale span { display: block; padding: 8px 0; border: 1px solid #889495; border-radius: 4px; pointer-events: none; background: #fffefa; }
.scale input:checked + span { color: white; background: var(--active); border-color: var(--active); }
.scale input:focus-visible + span { outline: 3px solid #ad6239; outline-offset: 1px; }
.ends { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 0; max-width: 420px; font-size: .85rem; color: var(--muted); }
.ends span:last-child { text-align: right; }
.survey-rest { margin-top: 28px; }
.survey-rest .survey-item { padding: 0 0 18px; }
#gameFrame { display: block; width: 100%; min-height: 360px; height: 720px; border: 0; }
main:has(#gameFrame) { padding-top: 12px; width: min(100%, 1140px); }
textarea { min-height: 64px; resize: vertical; }
.bonus { display: inline-block; padding: 9px 14px; background: #edeae0; border-radius: 4px; font: 1.05rem/1.45 ui-monospace,monospace; user-select: all; }
@media(max-width:520px) { .mast { padding: 12px 0; }.scale span { padding: 10px 0; } }
button.back { background: transparent; color: var(--muted); border: 0; padding: 10px 18px; text-decoration: underline; text-underline-offset: .2em; }
