/* Ежедневный челлендж скорочтения: бумажный беж, serif, красная опорная буква (как в роликах). */
:root {
  --bg: #f3f0e5;
  --glow: #faf8f2;
  --line: #b4aa9a;
  --ink: #141210;
  --red: #9e2226;
  --label: #3c3834;
  --muted: #6b655c;
  --card: #ebe7d9;
  --serif: "Times New Roman", Times, "Liberation Serif", "Noto Serif", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

.sp {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.sp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: var(--muted);
}

.sp-top a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }

.sp-screen { flex: 1; display: flex; flex-direction: column; }
.sp-screen[hidden] { display: none; }

h1 { font-size: 34px; line-height: 1.1; margin: 28px 0 6px; font-weight: 700; }
.sp-day { color: var(--red); font-size: 22px; margin: 0 0 14px; }
.sp-intro { margin: 0 0 22px; color: var(--label); }

.sp-langs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.sp-langs button {
  font: inherit; font-size: 16px; min-width: 48px; min-height: 44px;
  padding: 6px 12px; background: transparent; color: var(--label);
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
}
.sp-langs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.sp-btn {
  font: inherit; font-size: 22px; font-weight: 700; min-height: 56px;
  padding: 12px 28px; background: var(--ink); color: var(--bg);
  border: 0; border-radius: 4px; cursor: pointer; text-align: center;
  text-decoration: none; display: inline-block;
}
.sp-btn:active { transform: translateY(1px); }
.sp-btn.alt { background: transparent; color: var(--ink); border: 1px solid var(--ink); font-weight: 400; }
.sp-btn.red { background: var(--red); }

/* Сцена чтения */
.sp-stage {
  position: relative; flex: 1; min-height: 360px; margin: 16px -16px;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background: radial-gradient(ellipse at center, var(--glow) 0%, var(--bg) 70%);
}
.sp-rail {
  position: relative; width: 100%; height: 180px;
  border-top: 3px solid var(--line); border-bottom: 3px solid var(--line);
}
/* Засечки оси на обеих линиях, ось на 40 % ширины */
.sp-rail::before, .sp-rail::after {
  content: ""; position: absolute; left: 40%; width: 3px; height: 36px;
  margin-left: -1.5px; background: var(--line);
}
.sp-rail::before { top: 0; }
.sp-rail::after { bottom: 0; }

.sp-word {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr);
  align-items: center; white-space: pre;
  font-size: clamp(34px, 11vw, 64px); line-height: 1;
}
.sp-word .pre { text-align: right; overflow: hidden; }
.sp-word .post { text-align: left; overflow: hidden; }
.sp-word .piv { color: var(--red); }

.sp-wpm { text-align: center; color: var(--label); font-style: italic; font-size: 22px; margin: 0 0 12px; min-height: 30px; }
.sp-broke { width: 100%; }

/* Вопросы */
.sp-qn { color: var(--muted); margin: 24px 0 6px; }
.sp-q { font-size: 26px; line-height: 1.25; margin: 0 0 20px; }
.sp-opts { display: flex; flex-direction: column; gap: 10px; }
.sp-opts button {
  font: inherit; text-align: left; min-height: 56px; padding: 10px 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 4px; cursor: pointer;
}
.sp-opts button.ok { border-color: #3b6b3a; background: #dde8d6; }
.sp-opts button.bad { border-color: var(--red); background: #ecd5d2; }

/* Итог */
.sp-big { font-size: 30px; line-height: 1.2; margin: 26px 0 8px; font-weight: 700; }
.sp-big em { color: var(--red); font-style: normal; }
.sp-sub { margin: 0 0 6px; color: var(--label); }
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.sp-actions .sp-btn { flex: 1 1 200px; font-size: 19px; }
.sp-card-prev { display: block; width: 100%; max-width: 320px; height: auto; margin: 14px auto 0; border: 1px solid var(--line); }
.sp-tomorrow { margin: 18px 0; color: var(--muted); font-style: italic; }

.sp-promo { border-top: 3px solid var(--line); margin-top: 22px; padding-top: 18px; }
.sp-game { display: flex; gap: 14px; align-items: center; }
.sp-game img { width: 72px; height: 72px; border-radius: 14px; flex: none; }
.sp-game h2 { font-size: 22px; margin: 0 0 2px; }
.sp-game p { margin: 0; font-size: 16px; color: var(--label); }
.sp-game-btn { margin-top: 14px; width: 100%; }
.sp-follow { margin: 20px 0 8px; font-size: 16px; color: var(--muted); }
.sp-soc { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-soc a {
  color: var(--ink); text-decoration: none; font-size: 16px; min-height: 44px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px;
}

.sp-foot { margin-top: 28px; font-size: 14px; color: var(--muted); }
.sp-foot a { color: var(--muted); }

button:focus-visible, a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

@media (min-width: 700px) {
  .sp-stage { margin-left: 0; margin-right: 0; }
}
.sp-rows { list-style: none; margin: 10px 0 6px; padding: 0; color: var(--label); font-size: 17px; line-height: 1.6; }
.sp-stay { margin: 18px 0 0; font-size: 18px; font-style: italic; }

/* Тихая текстовая кнопка: «Пройти заново», «Ещё раз этот текст» */
.sp-link { display: block; margin: 14px auto 0; padding: 10px 12px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 17px; font-style: italic; text-decoration: underline; cursor: pointer; }
.sp-link:disabled { opacity: .5; }

.sp-link[hidden], .sp-btn[hidden] { display: none; }
.sp-more { display: block; width: 100%; margin-top: 14px; }
