/* ==========================================================
   views.css — главная и тест в разметке по макетам стилей
   (js/screens/home-views.js, js/screens/test-views.js).
   Здесь общая раскладка; отличия стилей — в looks.css.
   ========================================================== */

.hand {
  font-family: var(--font-hand);
  font-weight: 700;
  line-height: 1.05;
  color: var(--hand);
}

/* ---------- Полоса из отрезков и «температурный лист» ---------- */
.segs {
  display: flex;
  gap: 4px;
  margin: 12px 0 2px;
}

.seg-cell {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--seg-off);
}

.seg-cell.ok,
.seg-cell.done {
  background: var(--accent);
}

.seg-cell.no {
  background: var(--bad);
}

.temp-sheet {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
}

.temp-sheet .ts-grid {
  stroke: var(--line, var(--border));
  stroke-width: 1;
  fill: none;
}

.temp-sheet .ts-line {
  fill: none;
  stroke: var(--hand);
  stroke-width: 2;
  stroke-linejoin: round;
}

.temp-sheet .ts-dot {
  fill: var(--hand);
}

.temp-sheet .ts-dot.last {
  fill: var(--surface);
  stroke: var(--hand);
  stroke-width: 2;
}

.ts-legend {
  display: grid;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 6px;
}

.ts-n2 { grid-template-columns: repeat(2, 1fr); }
.ts-n3 { grid-template-columns: repeat(3, 1fr); }
.ts-n4 { grid-template-columns: repeat(4, 1fr); }
.ts-n5 { grid-template-columns: repeat(5, 1fr); }
.ts-n6 { grid-template-columns: repeat(6, 1fr); }
.ts-n7 { grid-template-columns: repeat(7, 1fr); }
.ts-n8 { grid-template-columns: repeat(8, 1fr); }

/* ================= Главная ================= */
.hm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0 4px;
}

.hm-head .grow {
  flex: 1;
  min-width: 0;
}

.hm-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hm-head .avatar {
  width: 46px;
  height: 46px;
}

.hm-roman .roman-say .roman-img {
  width: 84px;
  height: 96px;
  border-radius: 18px;
  background: var(--surface-2);
}

.hm-sign {
  margin: 6px 0 0 96px;
}

/* Задание дня */
.hm-task {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--task-bg);
  color: var(--task-text);
}

.hm-task-art {
  position: absolute;
  right: -16px;
  top: -26px;
  color: var(--accent);
  opacity: 0.35;
  pointer-events: none;
}

/* Сердце — над строкой «вопросы, минуты», чтобы не залезать под текст */
.hm-task-art .icon {
  width: 96px;
  height: 96px;
  stroke-width: 1.1;
}

.hm-kicker {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.hm-task-title {
  position: relative;
  max-width: calc(100% - 64px);
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hm-task-meta {
  position: relative;
  margin-top: 6px;
  font-size: 14px;
  color: var(--task-muted);
}

.hm-go {
  position: relative;
  margin-top: 16px;
}

.hm-go .icon {
  width: 20px;
  height: 20px;
}

/* Три показателя */
.hm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hm-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  min-width: 0;
}

.hm-stat b {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.hm-stat-icon {
  color: var(--accent);
}

.hm-stat-icon.fire {
  color: var(--flame);
}

.hm-stat-icon.xp {
  color: var(--xp);
}

.hm-stat .bar {
  width: 100%;
  height: 4px;
  margin-top: 8px;
  background: var(--xp-bg);
}

.hm-stat .bar.xp > span {
  background: var(--xp);
}

/* Плитки разделов */
.hm-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hm-tile {
  position: relative;
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border-radius: 20px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: transform 0.12s ease;
}

.hm-tile:active {
  transform: scale(0.96);
}

.hm-tile .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.6;
}

.hm-tile.t1 { background: var(--t1-bg); }
.hm-tile.t2 { background: var(--t2-bg); }
.hm-tile.t3 { background: var(--t3-bg); }
.hm-tile.t4 { background: var(--t4-bg); }
.hm-tile.t5 { background: var(--t5-bg); }
.hm-tile.t6 { background: var(--t6-bg); }
.hm-tile.t1 .icon { color: var(--t1-fg); }
.hm-tile.t2 .icon { color: var(--t2-fg); }
.hm-tile.t3 .icon { color: var(--t3-fg); }
.hm-tile.t4 .icon { color: var(--t4-fg); }
.hm-tile.t5 .icon { color: var(--t5-fg); }
.hm-tile.t6 .icon { color: var(--t6-fg); }

.tile-soon {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

/* --- Ночная смена: Роман с облачком и неделя серии --- */
.nt-say {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.nt-roman {
  width: 108px;
  height: 132px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 22px;
  background: var(--surface-2);
}

.nt-bubble {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 22px 22px 22px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.nt-bubble .hand {
  font-size: 23px;
}

.nt-gold {
  color: var(--gold, var(--warn));
}

.nt-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.nt-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.nt-day.is-today {
  color: var(--gold, var(--warn));
  font-weight: 700;
}

.nt-day-dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
}

.nt-day-dot.lit {
  background: var(--gold, var(--warn));
  color: var(--on-warn);
}

.nt-day-dot.today {
  border: 2px dashed var(--gold, var(--warn));
  background: transparent;
  font-size: 13px;
}

.nt-day-dot .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* --- История болезни: карта, назначение, список --- */
.cd-head {
  position: relative;
  padding-top: 4px;
}

.cd-name {
  display: block;
  margin-top: 2px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: left;
}

.cd-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 230px;
  margin-top: 10px;
}

.cd-fields span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.cd-fields b {
  display: block;
  font-size: 24px;
  color: var(--text);
  border-bottom: 1px solid var(--text);
}

.cd-stamp {
  position: absolute;
  right: 4px;
  top: 8px;
  padding: 6px 10px;
  border: 2.5px solid var(--stamp, var(--bad));
  border-radius: 10px;
  color: var(--stamp, var(--bad));
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  transform: rotate(-9deg);
  opacity: 0.85;
  pointer-events: none;
}

.cd-rx-text {
  margin-top: 10px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 25px;
  line-height: 1.1;
  white-space: pre-line;
  color: var(--text);
}

.cd-sign {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px;
}

.cd-sign img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 50%;
  border: 1.5px solid var(--text);
}

.cd-sign .hand {
  font-size: 21px;
}

.cd-list {
  display: flex;
  flex-direction: column;
}

.cd-row {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 15px;
}

.cd-row-note {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.cd-row-note.good {
  color: var(--good);
  font-weight: 600;
}

/* ================= Тест ================= */
.tq {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.tq-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tq-head .grow {
  flex: 1;
  min-width: 0;
}

.tq-title {
  font-size: 16px;
  font-weight: 700;
}

.tq-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--flame);
}

.tq .segs {
  margin: 0;
}

.tq-topic .badge {
  margin: 0;
}

.tq .q-text {
  margin: 0;
  padding: 0 2px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.tq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Варианты ответа */
.tq .option {
  position: relative;
  min-height: 54px;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
}

.tq .option .radio {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--border);
  background: transparent;
  color: transparent;
}

.tq .option .radio .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.tq .opt-text {
  position: relative;
  flex: 1;
  min-width: 0;
}

.tq .option.selected {
  border: 2px solid var(--accent);
}

.tq .option.selected .radio,
.tq .option.correct .radio {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.tq .option.correct {
  border: 2px solid var(--accent);
  background: var(--task-bg);
  font-weight: 700;
}

.tq .option.wrong {
  border: 2px solid var(--bad);
  background: var(--bad-bg);
  font-weight: 700;
}

.tq .option.wrong .radio {
  border-color: var(--bad);
  background: var(--bad);
  color: var(--on-bad);
}

.tq .option.faded {
  opacity: 0.6;
}

.opt-verdict {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--bad);
}

.opt-verdict.hand {
  font-size: 22px;
  color: var(--hand);
}

/* Разбор */
.tq-roman {
  width: 64px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 16px;
  background: var(--surface-2);
}

.tq-fb-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tq-fb-top .hand,
.tq-fb .hand {
  font-size: 25px;
}

.tq-fb-top .grow {
  flex: 1;
  min-width: 0;
}

.tq-xp {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 10px;
  background: var(--xp-bg);
  color: var(--xp);
  font-size: 13px;
  font-weight: 800;
}

.tq-expl {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.tq-foot {
  margin-top: auto;
  padding-top: 4px;
}

.tq-main {
  min-height: 54px;
  font-size: 16px;
}

.tq-main .icon {
  width: 20px;
  height: 20px;
}

.tq-actions {
  display: flex;
  gap: 10px;
}

.tq-actions .btn:first-child {
  flex: 1;
}

.tq-actions .flex-1 {
  flex: 1.3;
}

/* Итог смены */
.tq-score {
  text-align: center;
}

.tq-score .big {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.tq-score .muted {
  margin-top: 8px;
}

.nt-bubble .tq-xp {
  display: inline-block;
}

.tq-actions .btn {
  padding: 10px 8px;
  font-size: 14.5px;
  white-space: nowrap;
}
