/* Trace and Draw: camera view with a faded picture on top. */
.tr-steps { list-style: none; padding: 0; margin: 0 auto 16px; max-width: 620px; display: grid; gap: 8px; }
.tr-steps li { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 2px 10px rgba(20,33,61,.06); line-height: 1.4; }
.tr-steps p { margin: 0; }
.tr-steps span { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink, #14213D); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tr-own { text-align: center; margin: 22px auto 0; max-width: 620px; }
.tr-own label { cursor: pointer; display: inline-block; }
.tr-own p { font-size: 13px; color: var(--muted, #6b7785); margin: 6px 0 0; }
.tr-tips { max-width: 620px; margin: 26px auto 0; line-height: 1.5; }
.tr-tips h2 { font-size: 22px; text-align: center; }
.tr-tips ul { padding-left: 20px; }
.tr-tips li { margin-bottom: 6px; }

.tr-studio { position: fixed; inset: 0; z-index: 50; background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.tr-studio[hidden] { display: none; }
.tr-stage { position: absolute; inset: 0; }
.tr-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr-studio.tr-nocam .tr-stage { background: #fff; }
.tr-studio.tr-nocam video { display: none; }
.tr-lightbox { position: absolute; left: 12px; right: 12px; top: 64px; text-align: center; color: #556; font-size: 14px; }
.tr-lightbox[hidden] { display: none; }
.tr-pic { position: absolute; left: 50%; top: 50%; width: min(80vw, 80vh); aspect-ratio: 1; transform-origin: 50% 50%; will-change: transform; }
.tr-pic img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.tr-studio.tr-hidden .tr-pic { visibility: hidden; }

.tr-top, .tr-bottom { position: absolute; left: 0; right: 0; display: flex; gap: 8px; padding: 10px 12px; background: rgba(20,33,61,.72); color: #fff; }
.tr-top { top: 0; align-items: center; padding-top: max(10px, env(safe-area-inset-top)); }
.tr-bottom { bottom: 0; flex-direction: column; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.tr-word { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-word b { font-size: 22px; }
.tr-word span { opacity: .8; }
.tr-btn { border: 0; background: rgba(255,255,255,.16); color: #fff; border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tr-btn[aria-pressed="true"] { background: var(--sun, #F4B942); color: #14213D; }
.tr-btn:focus-visible { outline: 3px solid var(--sun, #F4B942); outline-offset: 2px; }
.tr-done { background: #2EC27E; }
.tr-fade { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.tr-fade input { flex: 1; accent-color: var(--sun, #F4B942); }
.tr-actions { display: flex; gap: 6px; justify-content: space-between; }
.tr-actions .tr-btn { flex: 1; padding: 10px 4px; font-size: 14px; }
.tr-msg { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); background: rgba(20,33,61,.85); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; max-width: calc(100% - 32px); text-align: center; }
.tr-msg[hidden] { display: none; }

.tr-finish { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tr-finish[hidden] { display: none; }
.tr-card { background: var(--cream, #FFFBF2); border-radius: 20px; padding: 22px 18px; text-align: center; max-width: 360px; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.tr-card p { margin: 0; color: var(--muted, #556); }
.tr-card > b { font-size: 44px; color: var(--ink, #14213D); line-height: 1.1; }
.tr-card > span { font-size: 18px; color: var(--muted, #556); }
.tr-card .tr-hint { margin: 6px 0 8px; }
