/* 타이머 무대. 넓은 화면: 1280x715 그림 위에 요소를 얹고 통째로 비율 축소.
   좁은 화면(.compact): 그림은 위에, 조작부는 아래에 차례로 놓는다. */
.stage-band { background: var(--st-bg); }
.stage { position: relative; max-width: 1280px; margin-inline: auto; aspect-ratio: 1280 / 715; overflow: hidden; background: var(--st-bg); color: var(--st-ink); font-family: var(--font-body); line-height: 1.3; }
.stage button { font-family: var(--font-body); }
.stage :focus-visible { outline: 3px solid var(--st-gold); outline-offset: 2px; }

.scene { position: absolute; inset: 0; overflow: hidden; }
.scene-inner { position: absolute; left: 0; top: 0; width: 1280px; height: 715px; transform-origin: 0 0; transform: translate(var(--ox, 0px), var(--oy, 0px)) scale(var(--k, 1)); }
.scene-inner img { position: absolute; left: 0; top: 0; width: 1280px; height: 715px; max-width: none; display: block; }
.scene-plain { position: absolute; inset: 0; background: radial-gradient(circle at 50% 118%, #2A3540 0%, #141B22 45%, #0E1218 75%); }
.scene-plain::before { content: ""; position: absolute; left: 50%; top: 44%; width: min(62%, 420px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(226, 194, 122, 0.28); box-shadow: 0 0 60px rgba(226, 194, 122, 0.08) inset; }
.scene-seogo, .scene-pav, .scene-plain, .scene-custom { display: none; }
.stage[data-scene="seogo"] .scene-seogo,
.stage[data-scene="pavilion"] .scene-pav,
.stage[data-scene="none"] .scene-plain,
.stage[data-scene="custom"] .scene-custom { display: block; }
.scene-inner.scene-custom img { position: absolute; left: 0; top: 0; width: 1280px; height: 715px; max-width: none; display: block; object-fit: cover; background: #0E1218; }
.stage[data-scene="pavilion"] .shade-top { height: 50%; background: linear-gradient(180deg, rgba(14, 20, 26, 0.62) 0%, rgba(14, 20, 26, 0.34) 55%, rgba(14, 20, 26, 0) 100%); }
.stage[data-scene="pavilion"] .line { top: 326px; }
.compact .stage[data-scene="pavilion"] .line, .stage.compact[data-scene="pavilion"] .line { top: auto; }
.stage[data-scene="pavilion"] .shade-bottom { background: linear-gradient(0deg, rgba(40, 14, 10, 0.52) 0%, rgba(40, 14, 10, 0.26) 60%, rgba(40, 14, 10, 0) 100%); }
.shade { position: absolute; left: 0; right: 0; pointer-events: none; }
.shade-top { top: 0; height: 42%; background: linear-gradient(180deg, rgba(10, 8, 14, 0.55) 0%, rgba(10, 8, 14, 0.28) 55%, rgba(10, 8, 14, 0) 100%); }
.shade-bottom { bottom: 0; height: 28%; background: linear-gradient(0deg, rgba(10, 8, 14, 0.6) 0%, rgba(10, 8, 14, 0.3) 60%, rgba(10, 8, 14, 0) 100%); }
.warm { position: absolute; inset: 0; background: radial-gradient(ellipse at 62% 62%, rgba(255, 190, 90, 0.28) 0%, rgba(255, 190, 90, 0) 60%); animation: warm 2.4s ease forwards; pointer-events: none; }

/* 촛불 */
.light { position: absolute; border-radius: 50%; mix-blend-mode: screen; pointer-events: none; animation: lightA 2.3s infinite linear paused; }
.light-a { left: 557px; top: 282px; width: 360px; height: 360px; background: radial-gradient(circle, rgba(255, 190, 96, 0.5) 0%, rgba(255, 170, 70, 0.2) 32%, rgba(255, 160, 60, 0.06) 55%, rgba(255, 160, 60, 0) 70%); }
.light-desk { left: 380px; top: 500px; width: 560px; height: 180px; background: radial-gradient(ellipse, rgba(255, 186, 110, 0.28) 0%, rgba(255, 186, 110, 0) 70%); }
.light-small { left: 524px; top: 366px; width: 90px; height: 90px; background: radial-gradient(circle, rgba(255, 196, 92, 0.5) 0%, rgba(255, 180, 70, 0.15) 40%, rgba(255, 180, 70, 0) 70%); animation: glow2 2.4s infinite ease-in-out; }
.flame { position: absolute; left: 725px; top: 435px; width: 24px; height: 46px; transform-origin: 50% 100%; animation: burn 2.3s infinite linear paused; pointer-events: none; }
.flame svg { display: block; overflow: visible; }
.flame .f1 { fill: #EC5326; } .flame .f2 { fill: #F7962E; }
.flame .f3 { fill: #FFE48E; transform-origin: 50% 100%; transform-box: fill-box; animation: core 1.1s infinite ease-in-out paused; }
.sparks { position: absolute; left: 737px; top: 446px; width: 0; height: 0; pointer-events: none; display: none; }
.sparks span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #FFD27A; box-shadow: 0 0 4px 1px rgba(255, 170, 60, 0.9); opacity: 0; animation: spark 2.9s infinite ease-out; }
.sparks span:nth-child(1) { --dx: -14px; left: -3px; animation-duration: 2.9s; animation-delay: 0.4s; }
.sparks span:nth-child(2) { --dx: 16px; left: 2px; animation-duration: 3.7s; animation-delay: 1.5s; }
.sparks span:nth-child(3) { --dx: 6px; left: -1px; animation-duration: 4.6s; animation-delay: 2.7s; }
.sparks span:nth-child(4) { --dx: -22px; left: 1px; animation-duration: 5.3s; animation-delay: 3.4s; }
.stage.burning .light, .stage.burning .flame, .stage.burning .flame .f3 { animation-play-state: running; }
.stage.burning .sparks { display: block; }
@keyframes burn { 0% { transform: scale(1, 1) skewX(0deg); } 7% { transform: scale(.96, 1.1) skewX(-4deg); } 13% { transform: scale(1.04, .93) skewX(3deg); } 19% { transform: scale(.97, 1.07) skewX(-2deg); } 24% { transform: scale(1.14, .78) skewX(6deg); } 27% { transform: scale(.93, 1.14) skewX(-5deg); } 36% { transform: scale(1.02, .97) skewX(2deg); } 45% { transform: scale(.95, 1.09) skewX(-3deg); } 52% { transform: scale(1.03, .95) skewX(4deg); } 58% { transform: scale(.98, 1.05) skewX(-1deg); } 63% { transform: scale(1.16, .74) skewX(-7deg); } 66% { transform: scale(.92, 1.16) skewX(5deg); } 74% { transform: scale(1.01, .98) skewX(-2deg); } 83% { transform: scale(.96, 1.08) skewX(3deg); } 91% { transform: scale(1.05, .92) skewX(-4deg); } 100% { transform: scale(1, 1) skewX(0deg); } }
@keyframes core { 0%, 100% { transform: scale(1, 1); } 22% { transform: scale(.9, 1.12); } 41% { transform: scale(1.08, .86); } 64% { transform: scale(.94, 1.1); } 85% { transform: scale(1.05, .92); } }
@keyframes lightA { 0%, 100% { opacity: .9; } 7% { opacity: 1; } 13% { opacity: .8; } 24% { opacity: .52; } 27% { opacity: 1; } 45% { opacity: .95; } 52% { opacity: .78; } 63% { opacity: .48; } 66% { opacity: 1; } 83% { opacity: .92; } 91% { opacity: .76; } }
@keyframes spark { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 6% { opacity: 1; } 60% { opacity: .9; } 100% { transform: translate(var(--dx), -58px) scale(.3); opacity: 0; } }
/* 참새 */
.bird { position: absolute; left: 556px; top: 552px; width: 78px; opacity: 0; pointer-events: none; }
.bird-bob { display: block; transform-origin: 50% 100%; }
.bird-wing { display: block; transform-origin: 50% 92%; }
.bird img { position: static; display: block; width: 100%; height: auto; max-width: none; }
.stage.bird-in .bird { opacity: 1; animation: flyIn 1.5s cubic-bezier(.22,.7,.3,1) both; }
.stage.bird-in .bird-wing { animation: flap .16s infinite ease-in-out; }
.stage.bird-perch .bird, .stage.bird-sing .bird { opacity: 1; }
.stage.bird-perch .bird-bob { animation: bob 3.4s infinite ease-in-out; }
.stage.bird-perch .bird-wing { animation: flap 2.6s infinite ease-in-out; }
.stage.bird-sing .bird-bob { animation: singbob 1.5s ease-in-out; }
.stage.bird-sing .bird-wing { animation: flap .4s 4 ease-in-out; }
.stage.bird-out .bird { opacity: 0; animation: flyOut 1.1s ease-in both; }
.stage.bird-out .bird-wing { animation: flap .14s infinite ease-in-out; }
@keyframes flyIn { 0% { transform: translate(330px, -230px) scale(.5); opacity: 0; } 18% { opacity: 1; } 62% { transform: translate(96px, -82px) scale(.82); } 85% { transform: translate(4px, -14px) scale(1.02); } 100% { transform: translate(0, 0) scale(1); opacity: 1; } }
@keyframes flyOut { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 25% { transform: translate(-10px, -26px) scale(1.02); opacity: 1; } 100% { transform: translate(300px, -250px) scale(.45); opacity: 0; } }
@keyframes flap { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.74); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(-1.5deg); } }
@keyframes singbob { 0% { transform: translateY(0) rotate(0deg); } 18% { transform: translateY(-7px) rotate(-6deg); } 40% { transform: translateY(-1px) rotate(1deg); } 62% { transform: translateY(-6px) rotate(-5deg); } 82% { transform: translateY(-1px) rotate(1deg); } 100% { transform: translateY(0) rotate(0deg); } }
/* 올빼미 (고요한 먹빛) */
.owl { --ow: 60px; position: absolute; left: 1088px; top: 192px; width: var(--ow); height: calc(var(--ow) * 1.405); opacity: 0; pointer-events: none; }
.owl-body { display: block; transform-origin: 45% 85%; }
.scene-inner .owl img { position: static; display: block; width: 100%; height: auto; max-width: none; filter: brightness(.86) saturate(.9); }
/* 날아오는 올빼미: 몸통 + 양 날개 세 장을 겹쳐 날개만 접었다 폈다 한다. 발끝이 앉은 올빼미의 발끝과 맞도록 둔다 */
.owl-fly { position: absolute; left: calc(var(--ow) * -1.263); top: calc(var(--ow) * -0.287); width: calc(var(--ow) * 3.4); height: calc(var(--ow) * 1.78); opacity: 0; }
.owl-fly span { position: absolute; inset: 0; }
.scene-inner .owl-fly img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.owl-fly .wl { transform-origin: 37.3% 41%; }
.owl-fly .wr { transform-origin: 58.3% 41%; }
.stage.owl-in .owl { opacity: 1; animation: owlIn 4s cubic-bezier(.3,.5,.35,1) both; }
.stage.owl-in .owl-fly { animation: flyShow 4s linear both; }
.stage.owl-in .owl-body { animation: perchShow 4s linear both; }
.stage.owl-in .owl-fly .wl, .stage.owl-out .owl-fly .wl { animation: flapL .42s infinite ease-in-out; }
.stage.owl-in .owl-fly .wr, .stage.owl-out .owl-fly .wr { animation: flapR .42s infinite ease-in-out; }
.stage.owl-in .owl-fly .bd, .stage.owl-out .owl-fly .bd { animation: flyBob .42s infinite ease-in-out; }
.stage.owl-perch .owl, .stage.owl-sing .owl { opacity: 1; }
.stage.owl-perch .owl-body { animation: owlBreath 4.2s infinite ease-in-out; }
.stage.owl-sing .owl-body { animation: owlHoot 1.9s ease-in-out; }
.stage.owl-out .owl { opacity: 0; animation: owlOut 1.8s ease-in both; }
.stage.owl-out .owl-fly { animation: flyShowOut 1.8s linear both; }
.stage.owl-out .owl-body { animation: perchHide 1.8s linear both; }
@keyframes owlIn { 0% { transform: translate(-470px, -150px) scale(.45) rotate(8deg); opacity: 0; } 8% { opacity: 1; } 35% { transform: translate(-300px, -175px) scale(.6) rotate(4deg); } 62% { transform: translate(-120px, -95px) scale(.8) rotate(-4deg); } 84% { transform: translate(-10px, -14px) scale(1) rotate(-2deg); } 92% { transform: translate(0, 2px) scale(1.02, .96); } 100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; } }
@keyframes owlOut { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 18% { transform: translate(0, 3px) scale(1.02, .95); opacity: 1; } 30% { transform: translate(-10px, -14px) scale(1); opacity: 1; } 100% { transform: translate(300px, -230px) scale(.5) rotate(-10deg); opacity: 0; } }
@keyframes flyShow { 0%, 84% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes perchShow { 0%, 84% { opacity: 0; } 92%, 100% { opacity: 1; } }
@keyframes flyShowOut { 0%, 14% { opacity: 0; } 24%, 100% { opacity: 1; } }
@keyframes perchHide { 0%, 14% { opacity: 1; } 24%, 100% { opacity: 0; } }
@keyframes flapL { 0%, 100% { transform: skewY(16deg) scaleY(1.04); } 50% { transform: skewY(-22deg) scaleY(.72); } }
@keyframes flapR { 0%, 100% { transform: skewY(-16deg) scaleY(1.04); } 50% { transform: skewY(22deg) scaleY(.72); } }
@keyframes flyBob { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-3px); } }
@keyframes owlBreath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.02); } }
@keyframes owlHoot { 0% { transform: scale(1, 1) rotate(0deg); } 12% { transform: scale(1.05, .97) rotate(-3deg); } 26% { transform: scale(1, 1) rotate(0deg); } 50% { transform: scale(1, 1); } 57% { transform: scale(1.04, .97) rotate(-2deg); } 66% { transform: scale(1, 1); } 74% { transform: scale(1.05, .97) rotate(-3deg); } 88%, 100% { transform: scale(1, 1) rotate(0deg); } }
.owl-notes { position: absolute; left: 1100px; top: 186px; width: 0; height: 0; pointer-events: none; }
.owl-notes i { position: absolute; font-style: normal; font-size: 14px; line-height: 1; color: #FFF3D0; text-shadow: 0 2px 6px rgba(0, 0, 0, .55); opacity: 0; }
.stage.owl-sing .owl-notes i { animation: noteUp 1.8s ease-out; }
.owl-notes i:nth-child(1) { --nx: -18px; animation-delay: 0s !important; }
.owl-notes i:nth-child(2) { --nx: -6px; font-size: 12px; animation-delay: .95s !important; }
.stage.compact .owl { --ow: 80px; left: 1079px; top: 168px; }
.stage.compact .owl-notes { top: 160px; }
/* 올빼미가 날아와 앉는 장면은 기기의 '동작 줄이기' 설정과 상관없이 보여 준다(루씨님 요청). 앉아 있는 동안의 숨쉬기만 멈춘다. */
@media (prefers-reduced-motion: reduce) { .stage.owl-perch .owl-body { animation: none !important; } }
.notes { position: absolute; left: 600px; top: 520px; width: 0; height: 0; pointer-events: none; }
.notes i { position: absolute; font-style: normal; font-size: 19px; line-height: 1; color: #FFF3D0; text-shadow: 0 2px 6px rgba(0, 0, 0, .55); opacity: 0; }
.stage.bird-sing .notes i { animation: noteUp 1.6s ease-out; }
.notes i:nth-child(1) { --nx: -26px; animation-delay: 0s !important; }
.notes i:nth-child(2) { --nx: 6px; font-size: 15px; animation-delay: .35s !important; }
.notes i:nth-child(3) { --nx: -12px; font-size: 13px; animation-delay: .7s !important; }
@keyframes noteUp { 0% { transform: translate(0, 0) rotate(-6deg); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--nx), -62px) rotate(10deg); opacity: 0; } }

@keyframes glow2 { 0%, 100% { transform: scale(1); opacity: .8; } 40% { transform: scale(.92); opacity: .65; } 70% { transform: scale(1.07); opacity: 1; } }
@keyframes warm { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: .55; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* 글자와 조작부 (넓은 화면 기준 좌표) */
.layer { position: absolute; left: 0; top: 0; width: 1280px; height: 715px; transform-origin: 0 0; transform: scale(var(--hk, 1)); pointer-events: none; }
.layer button, .layer input, .layer section { pointer-events: auto; }
.layer > * { position: absolute; }

.toprow { right: 11px; top: 10px; display: flex; align-items: center; gap: 8px; }
.reign { height: 38px; padding: 0 14px 0 4px; border-radius: 19px; background: rgba(30, 22, 18, 0.82); display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.reign i { width: 30px; height: 30px; border-radius: 50%; background: var(--st-red); border: 1px solid var(--st-gold); display: flex; align-items: center; justify-content: center; font-style: normal; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--st-paper); }
.icon-btn { width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(30, 22, 18, 0.6); color: var(--st-ink); padding: 0; display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.square { border-radius: 8px; }
.set-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 11px; border: none; border-radius: 22px; background: rgba(30, 22, 18, 0.6); color: var(--st-ink); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.set-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.set-btn:hover { background: rgba(30, 22, 18, 0.78); }

.titles { left: 0; top: 34px; width: 1280px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.titles h1 { font-size: 46px; line-height: 1.2; font-weight: 700; color: var(--st-ink); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }
.subline { display: flex; align-items: center; gap: 6px; }
.subline p { font-family: var(--font-display); font-size: 22px; line-height: 1.4; color: var(--st-soft); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.rename { height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid rgba(226, 194, 122, 0.6); background: rgba(30, 22, 18, 0.6); color: var(--st-soft); font-size: 13px; }

.timer { left: 0; top: 148px; width: 1280px; display: flex; justify-content: center; }
.timer-box { position: relative; }
.digits { font-size: 132px; line-height: 1; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }
.sijin { position: absolute; left: 100%; top: 34px; padding-left: 12px; display: flex; flex-direction: column; font-family: var(--font-display); font-size: 23px; line-height: 1.25; white-space: nowrap; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.sijin time { margin-top: 8px; font-family: var(--font-body); font-size: 19px; font-weight: 500; color: var(--st-soft); font-variant-numeric: tabular-nums; }
.timer-label { margin-top: 6px; text-align: center; font-size: 15px; font-weight: 500; letter-spacing: 0.08em; color: var(--st-soft); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }

.line { left: 240px; top: 584px; width: 800px; text-align: center; font-family: var(--font-display); font-size: 29px; line-height: 1.35; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.6); min-height: 1.35em; }
.line.pop { animation: fadeUp .6s ease; }

.dur { left: 972px; top: 150px; width: 196px; padding: 12px 8px 10px; border-radius: 10px; background: var(--st-panel); border: 1px solid rgba(226, 194, 122, 0.45); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.dur h2 { margin: 0 4px; font-size: 16px; font-weight: 700; color: var(--st-soft); }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.chip-btn { height: 44px; padding: 0; border-radius: 8px; border: 2px solid var(--st-line); background: rgba(30, 22, 18, 0.6); color: var(--st-soft); font-size: 15px; font-weight: 700; }
.chip-btn[aria-pressed="true"] { background: var(--st-gold); border-color: var(--st-gold); color: var(--st-dark); }
.custom { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--st-soft); }
.custom label { font-size: 13px; padding-left: 4px; white-space: nowrap; }
.custom input { flex: 1 1 auto; min-width: 0; width: 52px; height: 44px; padding: 0 6px; border-radius: 8px; border: 2px solid var(--st-line); background: var(--st-paper); color: var(--st-dark); font-size: 16px; font-weight: 700; text-align: center; }
.custom input.on { border-color: var(--st-gold); }
.custom button { height: 44px; padding: 0 12px; border-radius: 8px; border: none; background: var(--st-gold); color: var(--st-dark); font-size: 14px; font-weight: 700; }
.dur small { margin: 0 4px; font-size: 12px; line-height: 1.45; color: #D9C9A8; }

.gauge { left: 1166px; top: 152px; width: 86px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gauge b { font-family: var(--font-display); font-size: 19px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.gauge-bar { position: relative; width: 34px; height: 360px; border-radius: 17px; border: 2px solid rgba(255, 255, 255, 0.7); background: rgba(74, 48, 48, 0.88); overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.gauge-fill { position: absolute; left: 0; bottom: 0; width: 100%; height: var(--p, 0%); background: linear-gradient(180deg, #A9E2F2 0%, #5FB3DD 45%, #3A86C4 100%); transition: height .5s linear, width .5s linear; }
.gauge span { font-size: 14px; font-weight: 500; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums; }

.actions { left: 0; top: 640px; width: 1280px; display: flex; justify-content: center; gap: 14px; }
.act { width: 150px; height: 46px; border-radius: 3px; font-size: 18px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); outline-offset: -5px; }
.act-main { border: 1px solid #7A5C3E; outline: 1px solid rgba(255, 255, 255, 0.7); background: #F4ECDD; color: #2A1C14; font-weight: 700; }
.act-sub { border: 1px solid var(--st-dark); outline: 1px solid rgba(243, 233, 210, 0.45); background: #4A3530; color: var(--st-soft); font-weight: 500; }
.act-sub:disabled { background: rgba(74, 53, 48, 0.7); color: rgba(243, 233, 210, 0.55); }
.stage .act:focus-visible { outline: 3px solid var(--st-gold); outline-offset: 2px; }
.lock { left: 0; top: 691px; width: 1280px; text-align: center; font-size: 13px; color: var(--st-soft); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }

.tools { left: 14px; top: 664px; display: flex; align-items: center; gap: 6px; }
.amb-btn { height: 44px; padding: 0 16px 0 14px; border: none; border-radius: 22px; background: rgba(30, 22, 18, 0.6); color: var(--st-soft); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { display: block; width: 3px; height: 14px; border-radius: 2px; background: var(--st-gold); transform-origin: 50% 100%; animation: bar 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .25s; } .eq i:nth-child(3) { animation-delay: .5s; }
.stage.amb-on .eq { display: flex; }

/* 좁은 화면 */
.stage.compact { aspect-ratio: auto; overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr); }
.compact .scene { position: relative; grid-area: 1 / 1; aspect-ratio: 1 / 1; max-height: 460px; width: 100%; }
.compact .hud-over { pointer-events: none; }
.compact .layer { position: static; width: auto; height: auto; transform: none; }
.compact .layer > * { position: static; width: auto; }
.compact .hud-over { grid-area: 1 / 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px 12px; background: linear-gradient(180deg, rgba(10, 8, 14, 0.66) 0%, rgba(10, 8, 14, 0.34) 46%, rgba(10, 8, 14, 0) 72%); }
.compact .toprow { align-self: stretch; justify-content: space-between; }
.compact .reign { font-size: 14px; }
.compact .titles h1 { font-size: 22px; }
.compact .subline p { font-size: 15px; }
.compact .timer-box { display: flex; flex-direction: column; align-items: center; }
.compact .digits { font-size: clamp(56px, 19vw, 88px); }
.compact .sijin { position: static; padding: 0; flex-direction: row; align-items: baseline; gap: 8px; font-size: 15px; }
.compact .sijin time { margin: 0; font-size: 14px; }
.compact .timer-label { margin-top: 2px; font-size: 13px; }

.compact .hud-under { grid-area: 2 / 1; display: grid; gap: 14px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); background: var(--st-bg); }
.compact .line { order: 0; font-size: 19px; min-height: 0; }
.compact .line:empty { display: none; }
.compact .actions { order: 1; }
.compact .act { flex: 1 1 0; width: auto; height: 52px; }
.compact .lock { order: 2; }
.compact .dur { order: 3; }
.compact .gauge { order: 4; flex-direction: row; gap: 10px; }
.compact .gauge-bar { flex: 1 1 auto; width: auto; height: 14px; border-radius: 7px; }
.compact .gauge-fill { width: var(--p, 0%); height: 100%; background: linear-gradient(90deg, #3A86C4 0%, #5FB3DD 55%, #A9E2F2 100%); }
.compact .tools { order: 5; flex-wrap: wrap; }

/* 수첩(배경음·기록) */
.book-back { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 14, 0.5); }
.book { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(400px, 100%); overflow-y: auto; background: #1B1614; color: var(--st-soft); border-left: 1px solid #6B4A30; padding: calc(18px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) 22px; display: flex; flex-direction: column; gap: 20px; font-family: var(--font-body); line-height: 1.5; }
.book :focus-visible { outline: 3px solid var(--st-gold); outline-offset: 2px; }
.book-head { display: flex; align-items: center; justify-content: space-between; }
.book h2 { font-size: 24px; color: var(--st-ink); }
.book h3 { font-family: var(--font-body); font-size: 15px; font-weight: 700; color: var(--st-gold); }
.book section { display: flex; flex-direction: column; gap: 10px; }
.book small { font-size: 12px; line-height: 1.55; color: #BFAE90; }
.vol { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.vol input { flex: 1 1 auto; min-width: 0; height: 32px; accent-color: var(--st-gold); }
.vol output { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.ghost { min-height: 44px; border-radius: 8px; border: 2px solid var(--st-line); background: transparent; color: var(--st-soft); font-size: 15px; font-weight: 500; }
.ghost:disabled { opacity: .5; }
.diary { padding: 18px; border-radius: 6px; background: var(--st-paper); color: var(--st-dark); display: flex; flex-direction: column; gap: 10px; }
.diary-head { display: flex; align-items: center; gap: 12px; }
.diary-head i { width: 38px; height: 38px; border-radius: 4px; background: var(--st-red); color: var(--st-paper); display: flex; align-items: center; justify-content: center; font-style: normal; font-family: var(--font-display); font-size: 21px; font-weight: 700; }
.diary-head b { font-family: var(--font-display); font-size: 20px; display: block; }
.diary-head span { font-size: 13px; color: #5A4A3A; }
.diary p { font-family: var(--font-display); font-size: 16px; line-height: 1.65; }

/* 상세 설정 · 알림 */
.book .gate { font-size: 14px; line-height: 1.6; color: #D9C9A8; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.book .pro { display: flex; flex-direction: column; gap: 12px; }
.book .row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.book .row.wrap { flex-wrap: wrap; }
.book .row-label { min-width: 70px; }
.book .row label { min-width: 70px; }
.book .row input[type="number"], .book .row input[type="time"] {
  height: 44px; padding: 0 10px; border-radius: 8px; border: 2px solid var(--st-line);
  background: var(--st-paper); color: var(--st-dark); font-family: inherit; font-size: 15px; font-weight: 700;
}
.book .row input[type="number"] { width: 92px; }
.book .row input[type="time"] { flex: 1 1 auto; min-width: 0; }
.ghost.small { min-height: 40px; padding: 0 12px; font-size: 14px; width: auto; }
.ghost[aria-pressed="true"] { background: var(--st-gold); border-color: var(--st-gold); color: var(--st-dark); font-weight: 700; }
.book .check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 40px; }
.book .check input { width: 20px; height: 20px; accent-color: var(--st-gold); }
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.day { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--st-line); background: transparent; color: var(--st-soft); font-size: 14px; font-weight: 700; }
.day[aria-pressed="true"] { background: var(--st-gold); border-color: var(--st-gold); color: var(--st-dark); }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(243, 233, 210, 0.08); }
.alert-txt { margin-right: auto; display: flex; flex-direction: column; }
.alert-txt b { font-size: 16px; font-variant-numeric: tabular-nums; }
.alert-txt span { font-size: 12px; color: #BFAE90; }
.alert-empty { font-size: 13px; color: #BFAE90; }
.warn { color: #F0A38E; }

/* ---------- 타이머 / 스톱워치 고르기 ---------- */
.mode-sw { position: absolute; left: 11px; top: 10px; display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(20, 15, 12, 0.5); }
.compact .mode-sw { position: static; margin: 2px auto 0; }
.mode-sw button { border: none; background: none; color: rgba(255, 248, 238, 0.68); font-size: 14px; font-weight: 600; padding: 7px 18px; border-radius: 999px; letter-spacing: -0.01em; }
.mode-sw button[aria-pressed="true"] { background: rgba(255, 246, 232, 0.92); color: #22160F; }
.mode-sw button:disabled { opacity: 0.4; }

/* ---------- 구간 기록 ---------- */
.lap h2 { margin-bottom: 8px; }
.lap-list { list-style: none; margin: 0; padding: 0; max-height: 168px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.lap-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 5px 2px; border-bottom: 1px solid rgba(255, 246, 232, 0.1); }
.lap-list li:last-child { border-bottom: none; }
.lap-list b { font-size: 12px; font-weight: 600; opacity: 0.72; }
.lap-list span { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 700; }
.lap-list i { font-style: normal; font-variant-numeric: tabular-nums; font-size: 12px; opacity: 0.62; }
.lap-list .lap-none { display: block; font-size: 12px; opacity: 0.6; border: none; padding: 6px 2px; }

/* ---------- 뽀모도로 안내 ---------- */
.pomo-steps { list-style: none; counter-reset: pm; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pomo-steps li { counter-increment: pm; position: relative; padding-left: 24px; font-size: 13px; line-height: 1.5; opacity: 0.92; }
.pomo-steps li::before { content: counter(pm); position: absolute; left: 0; top: 1px; width: 17px; height: 17px; border-radius: 50%; background: rgba(255, 246, 232, 0.16); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.pomo-steps b { font-size: 15px; font-weight: 700; }


/* ---------- 무대 안쪽도 모두 각지게 ---------- */
.stage *, .stage *::before, .stage *::after,
.book *, .book *::before, .book *::after,
.stage, .book, .mode-sw, .mode-sw button, .set-btn, .theme-thumb {
  border-radius: 0 !important;
}


/* ---------- 무대 글자 다듬기: 더 작고 담백하게 ---------- */
/* 명조는 무대의 큰 제목에만. 대사·시각·기록은 고딕입니다. */
.titles h1 { font-family: var(--font-display); font-size: 38px; line-height: 1.35; }
.subline p { font-family: var(--font-body); font-size: 17px; font-weight: 400; }
.digits { font-size: 120px; font-weight: 500; line-height: 1.2; }
.compact .digits { line-height: 1.2; }
.sijin { font-family: var(--font-body); font-size: 17px; font-weight: 500; line-height: 1.35; }
.sijin time { font-size: 15px; font-weight: 400; }
.timer-label { font-size: 13px; }
.line { font-family: var(--font-body); font-size: 22px; font-weight: 600; line-height: 1.45; min-height: 1.45em; letter-spacing: -0.02em; }
.gauge b { font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.act { font-size: 15px; font-weight: 600; }
.reign { font-size: 14px; }
.set-btn { font-size: 13px; height: 40px; }
.mode-sw button { font-size: 13px; padding: 7px 16px; }
.dur h2 { font-size: 14px; font-weight: 600; }
.book h2 { font-family: var(--font-body); font-size: 19px; font-weight: 600; }
.book h3 { font-size: 14px; font-weight: 600; }
.diary-head b { font-family: var(--font-body); font-size: 16px; font-weight: 600; }
.diary p { font-family: var(--font-body); font-size: 14px; line-height: 1.6; }
.compact .titles h1 { font-size: 20px; }
.compact .line { font-size: 16px; }


/* ---------- 숲길 시찰 ---------- */
.scene-forest, .scene-mook { display: none; }
.stage[data-scene="forest"] .scene-forest,
.stage[data-scene="mook"] .scene-mook { display: block; }
/* 고양이 (봄날의 궁궐 뜰): 시작하면 꽃밭에서 뛰어나와 앞 잔디밭에 앉고, 야옹 소리에 맞춰 고개를 갸웃한다 */
.cat { --cw: 62px; position: absolute; left: 269px; top: 490px; width: var(--cw); height: calc(var(--cw) * 1.527); opacity: 0; pointer-events: none; transform-origin: 50% 100%; }
.cat-sit { position: absolute; left: 0; bottom: 0; width: 100%; transform-origin: 50% 96%; }
.cat-run, .cat-back { position: absolute; left: calc(var(--cw) * -0.3); bottom: 0; width: calc(var(--cw) * 1.6); opacity: 0; transform-origin: 50% 90%; }
.cat-roll { position: absolute; left: calc(var(--cw) * -0.36); bottom: -4px; width: calc(var(--cw) * 1.56); opacity: 0; transform-origin: 50% 85%; }
.scene-inner .cat img { position: static; display: block; width: 100%; height: auto; max-width: none; }
.cat-shadow { position: absolute; left: 4%; right: 4%; bottom: -4px; height: 10px; background: radial-gradient(ellipse at center, rgba(40, 52, 20, .38), rgba(40, 52, 20, 0) 70%); }
/* 책·손·진달래 덤불을 배경과 똑같이 오려 고양이 위에 덮음 → 고양이가 덤불에서 나와 책 뒤로 지나감 */
.scene-inner .spring-cover { left: 280px; top: 415px; width: 560px; height: 300px; pointer-events: none; }
.stage.cat-in .cat { opacity: 1; animation: catIn 3.6s cubic-bezier(.35,.2,.45,1) both; }
.stage.cat-in .cat-run { animation: runShow 3.6s linear both; }
.stage.cat-in .cat-sit { animation: sitShow 3.6s linear both; }
.stage.cat-in .cat-run img, .stage.cat-out .cat-back img { animation: catHop .5s infinite ease-in-out; }
.stage.cat-hello .cat, .stage.cat-lie .cat, .stage.cat-bye .cat { opacity: 1; }
/* 인사: 앉아서 "야~옹" 하며 갸웃 */
.stage.cat-hello .cat-sit { animation: catMeow 1.3s ease-in-out .05s; }
/* 누워서 뒹굴뒹굴: 앉은 그림이 옆으로 쓰러지듯 사라지고, 누운 그림이 굴러 들어와 좌우로 흔들림 */
.stage.cat-lie .cat-sit { animation: sitDown .5s ease-in both; }
.stage.cat-lie .cat-roll { opacity: 1; animation: lieIn .9s ease-out both, lieRock 3.4s ease-in-out .9s infinite; }
.stage.cat-lie .cat-shadow { transform: scaleX(1.6); }
/* 작별: 벌떡 일어나 앉아 "야~옹" */
.stage.cat-bye .cat-roll { animation: lieOut .35s ease-in both; }
.stage.cat-bye .cat-sit { animation: sitUp .35s ease-out both, catMeow 1.3s ease-in-out .35s; }
.stage.cat-bye .cat-notes i { animation-name: noteUp; animation-duration: 1.8s; animation-timing-function: ease-out; }
.stage.cat-bye .cat-notes i:nth-child(1) { animation-delay: .35s !important; }
.stage.cat-bye .cat-notes i:nth-child(2) { animation-delay: .85s !important; }
.stage.cat-out .cat { opacity: 1; animation: catOut 3s ease-in-out both; }
.stage.cat-out .cat-sit { animation: sitTurn 3s linear both; }
.stage.cat-out .cat-back { animation: backTurn 3s linear both; }
/* 들어올 때: 오른쪽 진달래 덤불 속(712,512) → 잔디로 깡충 → 책 뒤 → 왼쪽 잔디(300,585)에 앉음 */
@keyframes catIn {
  0% { transform: translate(412px, -73px) scale(.58); }
  14% { transform: translate(392px, -52px) scale(.64); }
  26% { transform: translate(365px, -25px) scale(.74); }
  36% { transform: translate(328px, -19px) scale(.78); }
  62% { transform: translate(140px, -7px) scale(.9); }
  78% { transform: translate(45px, -1px) scale(.98); }
  88% { transform: translate(0, 2px) scale(1.04, .95); }
  100% { transform: none; } }
@keyframes runShow { 0%, 84% { opacity: 1; } 88%, 100% { opacity: 0; } }
@keyframes sitShow { 0%, 84% { opacity: 0; } 88%, 100% { opacity: 1; } }
/* 멈출 때: 그 자리에서 뒤돌아(앉은 고양이가 좁아졌다가 오른쪽 보는 고양이로) → 책 뒤 → 덤불 속으로 */
@keyframes catOut {
  0%, 16% { transform: none; }
  30% { transform: translate(60px, -2px) scale(.97); }
  55% { transform: translate(220px, -10px) scale(.86); }
  72% { transform: translate(340px, -19px) scale(.78); }
  86% { transform: translate(382px, -40px) scale(.7); }
  98% { transform: translate(412px, -73px) scale(.58); opacity: 1; }
  100% { transform: translate(412px, -73px) scale(.58); opacity: 0; } }
@keyframes sitTurn { 0% { transform: none; opacity: 1; } 9% { transform: scaleX(.08); opacity: 1; } 10%, 100% { transform: scaleX(.08); opacity: 0; } }
@keyframes backTurn { 0%, 9% { transform: scaleX(.08); opacity: 0; } 10% { transform: scaleX(.08); opacity: 1; } 18% { transform: none; opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes sitDown { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: rotate(-35deg) scale(.9); } }
@keyframes sitUp { 0% { opacity: 0; transform: rotate(-25deg) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes lieIn { 0% { opacity: 0; transform: translate(-6px, -14px) rotate(-30deg) scale(.8); } 45% { opacity: 1; transform: translate(2px, 0) rotate(10deg) scale(1); } 70% { transform: rotate(-4deg); } 100% { opacity: 1; transform: none; } }
@keyframes lieOut { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(0, -10px) rotate(-20deg) scale(.85); } }
@keyframes lieRock { 0%, 100% { transform: none; } 22% { transform: translateX(-3px) rotate(-8deg); } 50% { transform: translateX(1px) rotate(2deg); } 72% { transform: translateX(4px) rotate(9deg); } 88% { transform: translateX(1px) rotate(1deg); } }
@keyframes catHop { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-16px) rotate(4deg); } }
@keyframes catBreath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.01, 1.018); } }
@keyframes catMeow { 0% { transform: none; } 18% { transform: rotate(-5deg) scale(1.03, .98); } 42% { transform: rotate(3deg) scale(1, 1.02); } 68% { transform: rotate(-2deg); } 100% { transform: none; } }
.cat-notes { position: absolute; left: 308px; top: 478px; width: 0; height: 0; pointer-events: none; }
.cat-notes i { position: absolute; font-style: normal; font-size: 14px; line-height: 1; color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .45); opacity: 0; }
.stage.cat-hello .cat-notes i { animation: noteUp 1.8s ease-out; }
.cat-notes i:nth-child(1) { --nx: 10px; animation-delay: 0s !important; }
.cat-notes i:nth-child(2) { --nx: 22px; font-size: 12px; animation-delay: .5s !important; }
.stage.compact .cat { --cw: 80px; left: 260px; top: 463px; }
.stage.compact .cat-notes { top: 452px; }
@media (prefers-reduced-motion: reduce) { .stage.cat-lie .cat-roll { animation: lieIn .9s ease-out both !important; } }
.stage[data-scene="forest"] .shade-top { height: 52%; background: linear-gradient(180deg, rgba(12, 22, 16, 0.66) 0%, rgba(12, 22, 16, 0.36) 55%, rgba(12, 22, 16, 0) 100%); }
.stage[data-scene="forest"] .shade-bottom { background: linear-gradient(0deg, rgba(16, 24, 14, 0.6) 0%, rgba(16, 24, 14, 0.28) 60%, rgba(16, 24, 14, 0) 100%); }

/* 스케줄 따라가기 띠 (스케줄이 켜져 있을 때만 무대 위에 보임) */
.sched-strip { max-width: 1280px; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; margin-bottom: 0; border-bottom: 0; background: var(--surface, #FFFCF2); border: 1px solid var(--line, #DED4BB); font-size: 13px; }
.sched-strip[hidden] { display: none; }
.sched-strip-tag { background: var(--accent, #3F574A); color: #fff; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.sched-strip-name { font-weight: 600; }
.sched-strip-wait { color: var(--brass, #7A6008); }
.sched-strip-grow { flex: 1; }
.sched-strip a, .sched-strip button { font: inherit; font-size: 13px; color: var(--ink, #221E15); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
