/* The gym timer /timer (public/js/timer.js) — Nov 15 2026 */
body.tm { background: #04070c; color: #e9f1fa; min-height: 100vh; }
.tm-setup { max-width: 980px; margin: 0 auto; padding: 20px 16px 120px; }
.tm-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tm-head h1 { display: flex; align-items: center; gap: 10px; font: 900 clamp(28px, 4vw, 40px) var(--display, 'Archivo', sans-serif); margin: 0; }
.tm-head h1 svg { width: 1em; height: 1em; color: #29e6f2; }
.tm-back { color: #8fb3c8; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.tm-back svg { width: 16px; height: 16px; }
.tm-group { margin-top: 22px; }
.tm-group h2 { font: 800 20px var(--display, 'Archivo', sans-serif); margin: 0; }
.tm-sub { color: #8fa3b8; margin: 2px 0 10px; font-size: 14px; }
.tm-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tm-preset { text-align: left; background: #0d1622; border: 1px solid #1f2d3d; color: inherit; border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 76px; }
.tm-preset b { font: 800 18px var(--display, 'Archivo', sans-serif); }
.tm-preset span { color: #8fa3b8; font-size: 13px; }
.tm-preset:hover { border-color: #29e6f2; }
.tm-preset.on { border-color: #29e6f2; box-shadow: 0 0 0 3px rgba(41, 230, 242, .25); background: #0f2230; }
.tm-custom { margin-top: 22px; background: #0d1622; border: 1px solid #1f2d3d; border-radius: 14px; padding: 12px 14px; }
.tm-custom summary { font-weight: 800; cursor: pointer; }
.tm-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tm-modes .chip { background: #0a121c; color: #cfe0ee; border-color: #26384b; }
.tm-modes .chip.on { background: #29e6f2; color: #04070c; border-color: #29e6f2; }
.tm-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tm-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #a9bccd; }
.tm-field small { color: #6f8496; }
.tm-field input { background: #04070c; color: #e9f1fa; border: 1px solid #26384b; border-radius: 10px; padding: 10px; font: 700 18px var(--display, 'Archivo', sans-serif); width: 100%; box-sizing: border-box; }
.tm-mmss { display: flex; align-items: center; gap: 4px; font-weight: 800; color: #e9f1fa; }
.tm-mmss input { width: 4.2em; text-align: center; }
.tm-go { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(4, 7, 12, .96); border-top: 1px solid #1f2d3d; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; justify-content: center; }
.tm-sum { display: flex; flex-direction: column; min-width: 0; }
.tm-sum b { font: 800 18px var(--display, 'Archivo', sans-serif); }
.tm-sum span { color: #8fa3b8; font-size: 13px; }
.tm-start { min-width: 160px; font-size: 20px; }
.tm-start svg { width: 18px; height: 18px; }

/* running */
body.tm-running { overflow: hidden; }
.tm-run { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; padding: 16px; text-align: center; background: #04070c; transition: background .3s; }
.tm-run.ph-ready { background: #3a2a05; }
.tm-run.ph-work { background: #06301c; }
.tm-run.ph-rest { background: #3a0d12; }
.tm-run.ph-done { background: #0b1220; }
.tm-run.late .tm-digits { color: #ffd166; animation: tm-pulse 1s steps(2) infinite; }
.tm-run.paused .tm-digits { opacity: .55; animation: none; }
@keyframes tm-pulse { 50% { opacity: .55; } }
.tm-title { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px; font-weight: 700; color: rgba(233, 241, 250, .7); font-size: clamp(14px, 1.6vw, 22px); }
.tm-phase { font: 900 clamp(28px, 6vw, 84px) var(--display, 'Archivo', sans-serif); text-transform: uppercase; letter-spacing: .06em; }
.tm-digits { font: 900 clamp(96px, 27vw, 420px) / .9 var(--display, 'Archivo', sans-serif); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tm-round { font: 800 clamp(20px, 3.4vw, 52px) var(--display, 'Archivo', sans-serif); color: rgba(233, 241, 250, .9); min-height: 1.2em; }
.tm-next { font-size: clamp(14px, 1.8vw, 26px); color: rgba(233, 241, 250, .7); min-height: 1.3em; }
.tm-bar { width: min(900px, 90vw); height: 8px; background: rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; margin-top: 1vh; }
.tm-bar i { display: block; height: 100%; background: #29e6f2; width: 0; transition: width .25s linear; }
.tm-ctrls { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 12px; }
.tm-btn { background: rgba(255, 255, 255, .1); color: #e9f1fa; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 14px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 15px; }
.tm-btn svg { width: 18px; height: 18px; }
.tm-btn.main { background: #29e6f2; color: #04070c; border-color: #29e6f2; min-width: 130px; justify-content: center; }
.tm-btn.off { opacity: .55; }
@media (max-width: 640px) { .tm-btn span { display: none; } .tm-btn.main span { display: inline; } .tm-go { flex-wrap: wrap; } .tm-start { width: 100%; } }
/* On the TV (public/js/timer.js tvSheet / tvDraw) */
.tm-tvbtn.on { border-color: #29e6f2; color: #29e6f2; }
.tm-tvbtn svg { width: 18px; height: 18px; }
.tm-go .tm-tvbtn { background: transparent; color: #e9f1fa; border: 1px solid #26384b; }
.tm-tvbox { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.tm-qr { background: #fff; border-radius: 12px; padding: 8px; line-height: 0; }
.tm-qr canvas { width: 180px; height: 180px; }
.tm-tvbox > div:last-child { flex: 1 1 240px; }
.tm-code { font: 900 40px var(--display, 'Archivo', sans-serif); letter-spacing: .12em; margin: 4px 0 10px; }
.tm-mirror { margin-top: 10px; }
.tm-mirror summary { font-weight: 800; cursor: pointer; }
.tm-mirror ul { padding-left: 18px; }
.tm-on-tv { cursor: none; }
.tm-tvwait { font: 900 clamp(32px, 5vw, 90px) var(--display, 'Archivo', sans-serif); padding: 0 4vw; }
.tm-sound { position: absolute; bottom: 7vh; left: 50%; transform: translateX(-50%); background: #29e6f2; color: #04070c; border: 0; border-radius: 16px; padding: 18px 26px; font: 800 clamp(18px, 2.2vw, 30px) var(--display, 'Archivo', sans-serif); display: inline-flex; gap: 10px; align-items: center; cursor: pointer; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.tm-sound svg { width: 1.1em; height: 1.1em; }
.tm-tvcode { max-width: 640px; text-align: center; padding-top: 10vh; }
.tm-tvcode h1 { justify-content: center; display: flex; align-items: center; gap: 10px; font: 900 clamp(28px, 4vw, 48px) var(--display, 'Archivo', sans-serif); }
.tm-tvcode input.tm-codein { display: block; width: 100%; max-width: 420px; margin: 18px auto; text-align: center; font: 900 clamp(40px, 7vw, 72px) var(--display, 'Archivo', sans-serif); letter-spacing: .15em; text-transform: uppercase; background: #0d1622; color: #e9f1fa; border: 2px solid #29e6f2; border-radius: 16px; padding: 12px; box-sizing: border-box; }

.tm-tvcode .tm-sub { font-size: clamp(16px, 1.6vw, 28px); }
.tm-tvcode .btn.lg { font-size: clamp(18px, 1.8vw, 30px); padding: .6em 1.4em; }
