/* ============================================================
   ТАЙМЕР ДЛЯ НАСТОЛЬНЫХ ИГР — /timer
   Использует общий стиль .poker-page / .pk-* из styles.css и poker-timer.css
   ============================================================ */
.pk-stage-wrap.tm-top { padding-bottom: var(--space-2xl); }
.tm-head { text-align: center; max-width: 760px; margin: 0 auto var(--space-xl); }
.tm-head .pk-sub2 { margin-left: auto; margin-right: auto; }

.tm-card { max-width: 860px; margin: 0 auto; padding: clamp(var(--space-lg), 4vw, var(--space-2xl)); text-align: center; color: #fff; }

/* Экран времени */
.tm-display { padding: var(--space-md) 0 var(--space-lg); }
.tm-clock, .tm-unit input {
  font-family: var(--font); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
  font-size: clamp(3rem, 13vw, 7.5rem); color: #fff; letter-spacing: 0.01em;
}
.tm-clock { transition: color .3s; }
.tm-set { display: flex; justify-content: center; align-items: flex-start; gap: clamp(2px, 1.2vw, 12px); }
.tm-unit { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: text; }
.tm-unit input {
  width: 2.1ch; padding: 0; text-align: center; background: transparent; border: 0; border-bottom: 2px solid rgba(255,255,255,0.22);
  border-radius: 0; outline: none; -moz-appearance: textfield; appearance: textfield; transition: border-color .2s;
}
.tm-unit input::-webkit-outer-spin-button, .tm-unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tm-unit input:focus { border-bottom-color: var(--gold); }
.tm-unit span { color: rgba(255,255,255,0.55); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; }
.tm-colon { font-style: normal; font-family: var(--font); font-weight: 800; font-size: clamp(3rem, 13vw, 7.5rem); line-height: 1; color: rgba(255,255,255,0.35); }

.tm-progress { height: 6px; background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; margin: var(--space-lg) auto 0; max-width: 620px; opacity: 0; transition: opacity .3s; }
.tm-progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
.tm-card:not([data-status="idle"]) .tm-progress { opacity: 1; }

/* Режимы: idle — поля ввода, остальное — цифры */
.tm-card:not([data-status="idle"]) .tm-set { display: none; }
.tm-card[data-status="paused"] .tm-clock { color: rgba(255,255,255,0.55); animation: tm-blink 1.4s ease-in-out infinite; }
.tm-card[data-status="done"] .tm-clock { color: #ff6b5c; }
.tm-card.tm-warn .tm-clock { color: #ffb3a8; }
@keyframes tm-blink { 50% { opacity: 0.45; } }

.tm-done { margin: 0 auto var(--space-lg); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md, 16px); background: rgba(255,107,92,0.16); border: 1px solid rgba(255,107,92,0.5); animation: tm-pulse 1s ease-in-out infinite; }
.tm-done[hidden] { display: none; }
.tm-done b { display: block; font-size: clamp(1.4rem, 4vw, 2rem); font-family: var(--font); }
.tm-done span { color: rgba(255,255,255,0.8); }
@keyframes tm-pulse { 50% { background: rgba(255,107,92,0.3); } }

.tm-presets { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: center; margin-bottom: var(--space-lg); }
.tm-card:not([data-status="idle"]) .tm-presets { display: none; }
.tm-chip { background: rgba(255,255,255,0.07); color: #fff; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tm-chip:hover { background: rgba(201,162,90,0.16); border-color: var(--gold); color: var(--gold); }
.tm-chip.is-active { background: var(--gold); border-color: var(--gold); color: #240606; }

.tm-controls { display: flex; flex-wrap: wrap; gap: var(--space-smd); justify-content: center; }
.tm-controls [hidden] { display: none; }
.tm-main { min-width: 190px; justify-content: center; }

/* Факт */
.tm-fact { margin: var(--space-xl) auto 0; max-width: 680px; text-align: left; padding: var(--space-md) var(--space-lg) var(--space-lg); border-radius: 18px; background: rgba(201,162,90,0.12); border: 1px solid rgba(201,162,90,0.45); animation: tm-fact-in .5s cubic-bezier(.22,.9,.25,1); position: relative; overflow: hidden; }
.tm-fact[hidden] { display: none; }
@keyframes tm-fact-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tm-fact__top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.tm-fact__tag { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.tm-fact__tag b { color: #fff; font-weight: 700; }
.tm-fact__close { background: none; border: 0; color: rgba(255,255,255,0.6); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.tm-fact__close:hover { color: #fff; }
.tm-fact__text { margin: 0; font-size: clamp(1rem, 2.2vw, 1.18rem); line-height: 1.55; color: #fff; }
.tm-fact__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.08); }
.tm-fact__bar i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width .5s linear; }

/* Настройки */
.tm-settings { display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-xl); justify-content: center; align-items: center; margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid rgba(255,255,255,0.12); }
.tm-check { color: rgba(255,255,255,0.9); }
.tm-interval { display: inline-flex; align-items: center; gap: var(--space-sm); }
.tm-interval[hidden] { display: none; }
.tm-interval__label { color: rgba(255,255,255,0.65); font-size: 0.9rem; }
.tm-seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; overflow: hidden; }
.tm-seg__item { cursor: pointer; }
.tm-seg__item input { position: absolute; opacity: 0; pointer-events: none; }
.tm-seg__item span { display: block; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.8); transition: background .15s, color .15s; }
.tm-seg__item input:checked + span { background: var(--gold); color: #240606; }
.tm-seg__item input:focus-visible + span { outline: 2px solid #fff; outline-offset: -3px; }
.tm-hint { margin: var(--space-md) auto 0; max-width: 560px; color: rgba(255,255,255,0.6); font-size: 0.86rem; }
.tm-hint[hidden] { display: none; }

/* Контент */
.tm-why { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-cards); }
.tm-lead { margin-bottom: var(--space-lg); }
.tm-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-md); }
.tm-steps li { display: flex; gap: var(--space-md); align-items: flex-start; }
.tm-steps__num { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(201,162,90,0.16); color: var(--gold); font-weight: 800; }
.tm-steps b { color: #fff; display: block; margin-bottom: 2px; }
.tm-steps p { margin: 0; color: rgba(255,255,255,0.72); font-size: 0.94rem; }

/* Полноэкранный режим */
.tm-card:fullscreen { display: flex; flex-direction: column; justify-content: center; max-width: none; border-radius: 0; background: #170404; overflow: auto; }
.tm-card:fullscreen .tm-clock, .tm-card:fullscreen .tm-unit input { font-size: clamp(4rem, 24vw, 22rem); }
.tm-card:fullscreen .tm-fact { max-width: 900px; }

@media (max-width: 860px) { .tm-why { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .tm-controls .btn { flex: 1 1 100%; justify-content: center; }
  .tm-settings { flex-direction: column; align-items: flex-start; }
  .tm-fact { padding: var(--space-md); }
}
@media (prefers-reduced-motion: reduce) { .tm-card *, .tm-fact, .tm-done { animation: none !important; } }

/* Во время отсчёта на кнопке «Пауза» иконка «play» не нужна */
.tm-card[data-status="running"] .tm-main svg { display: none; }
