@font-face{font-family:Jua;src:url("./assets/Jua.woff2") format("woff2");font-display:swap;font-weight:400}
:root{
  --paper:#faf8f4;--ink:#282b3a;--muted:#656875;--edge:#e6e3dc;
  --purple:#6944c7;--light-purple:#f1ebfb;--display:Jua,"Malgun Gothic",sans-serif;
  font-family:"Pretendard","Noto Sans KR","Malgun Gothic",system-ui,sans-serif;
  color:var(--ink);background:var(--paper);line-height:1.45;-webkit-text-size-adjust:100%;
}
*{box-sizing:border-box}
body,h1,h2,p,fieldset,legend{margin:0}
body{min-height:100dvh}
button,input{font:inherit;color:inherit}
button,input,label{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;touch-action:manipulation}
button:focus-visible,input:focus-visible{outline:3px solid #9575e9;outline-offset:3px}
button:disabled{cursor:default}
[hidden]{display:none!important}
button{border:0;background:none}
fieldset{padding:0;border:0;min-width:0}
legend{padding:0}
svg{display:block}
[data-icon]{display:inline-flex;flex:none;width:19px;height:19px;font-style:normal}
[data-icon] svg{width:100%;height:100%}
#teacherView{display:grid;grid-template: auto minmax(0,1fr) / minmax(0,1fr);height:100vh;height:100dvh}
.topbar{z-index:1;background:#fff;border-bottom:1px solid var(--edge)}
.topbar-inner{display:flex;align-items:center;gap:clamp(12px,1.6vw,30px);min-height:66px;padding:9px clamp(14px,2.1vw,42px)}
.brand,.setup-tools,.transport,.screen-tools,.duration-row,.duration-input{display:flex;align-items:center}
.brand{gap:8px;padding-right:clamp(12px,1.5vw,28px);border-right:1px solid var(--edge);white-space:nowrap;color:inherit;text-decoration:none}
.brand:focus-visible{outline:3px solid #9575e9;outline-offset:3px}
.brand>span{display:grid;line-height:1.15}
.brand small{color:var(--purple);font-size:12px;text-decoration:underline;text-underline-offset:2px}
.brand img{display:block;border-radius:10px}
.brand strong{font-size:22px;letter-spacing:-1.5px;font-weight:850}
.setup-tools,.transport,.screen-tools{gap:7px}
.screen-tools{margin-left:auto}
.duration-row{--time-width:4.7rem;font-size:14px;gap:7px;white-space:nowrap;font-weight:750;margin-right:4px}
.duration-input,#remainingTime{width:var(--time-width);font-size:16px;font-variant-numeric:tabular-nums}
.duration-input{min-height:40px;border:1px solid #dcd9d4;border-radius:10px;padding:2px 4px;background:#fff}
.duration-input:focus-within{outline:3px solid #9575e9;outline-offset:2px}
.duration-input input{min-width:0;width:0;flex:1 1 0;min-height:30px;border:0;border-radius:4px;background:transparent;padding:2px 1px;font:inherit;text-align:right}
#durationSeconds{text-align:left}
.duration-input input:focus{outline:0;background:#f2eefb}
.duration-input>span{line-height:1}
#remainingTime{text-align:center}
.button,.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:10px;line-height:1.2;font-weight:750;white-space:nowrap}
.button{min-height:40px;padding:9px 13px;font-size:14px}
.icon-button{width:36px;height:36px;color:#626675;border:1px solid #e2e1dc;background:#fff}
.button:not(:disabled):hover,.icon-button:hover{filter:brightness(.96)}
.button:active:not(:disabled),.icon-button:active{transform:translateY(1px)}
.button:disabled{color:#898993;background:#f5f4f2;border-color:#e7e5e1}
.start-button{background:var(--purple);color:#fff;border:1px solid #5e38bf}
.outline-button{color:#53515f;background:#fff;border:1px solid #dbd8d3}
.open-window{background:#eee8fb;border:1px solid #ded4f3;color:#57399e}
.topbar .button>[data-icon]{width:16px;height:16px}
.workspace{min-height:0;min-width:0;position:relative}
.stage{position:absolute;inset:0;isolation:isolate;overflow:hidden;container-type:size;background:#caeaf7;color:#243447}
.stage[data-phase=ready]{background:#c4e9f8 url("./assets/ready-crossing.webp") 74% center / cover no-repeat}
.stage-content{position:absolute;inset:0;display:grid;place-items:center;padding:5cqh 4cqw 7cqh}
.stage-copy{width:100%;text-align:center;min-width:0}
.stage-title,.stage-action{margin:0;font-family:var(--display);font-weight:400;letter-spacing:-.035em;line-height:1.04;overflow-wrap:anywhere}
.stage-title{font-size:min(22cqw,36cqh);word-break:keep-all}
.stage-action{margin-top:3cqh;font-size:min(17cqw,25cqh,var(--action-width-limit,17cqw));text-wrap:balance}
.stage.long-action .stage-action{font-size:min(var(--action-width-limit),17cqh)}
.stage[data-color=red]{color:#fff;background:#bb283a}
.stage[data-color=yellow]{color:#332b1b;background:#ffce49}
.stage[data-color=green]{color:#fff;background:#16724e}
.stage[data-phase=ready] .stage-content{justify-items:start;padding:4cqh 6.5cqw 11cqh}
.stage[data-phase=ready] .stage-copy{width:44%;text-align:left}
.stage[data-phase=ready] .stage-title{font-size:min(15cqw,33cqh);color:#21384c}
.stage[data-phase=ready] .stage-action{font:700 min(3.1cqw,7.5cqh)/1.4 "Malgun Gothic",system-ui,sans-serif;color:#384f60;letter-spacing:-.06em;margin-top:1.4cqh}
.stage[data-phase=paused]{color:#383650;background:#e7e1f4}
.stage[data-phase=ended]{color:#1f5040;background:#d5eedf}
.stage:is([data-phase=paused],[data-phase=ended]) .stage-content{display:flex;align-items:center;justify-content:center;gap:5cqw}
.stage:is([data-phase=paused],[data-phase=ended]) .stage-copy{width:auto;text-align:left}
.stage-symbol{display:grid;place-items:center;width:min(16cqw,36cqh);height:min(16cqw,36cqh);border-radius:34%;background:#ffffffa6;flex:none}
.stage-symbol svg{width:56%;height:56%}
.stage:is([data-phase=paused],[data-phase=ended]) .stage-title{font-size:min(16cqw,33cqh)}
.stage:is([data-phase=paused],[data-phase=ended]) .stage-action{font-size:min(4.2cqw,9cqh)}
.red>.guide-label i{background:#d9544e}
.yellow>.guide-label i{background:#d59a16}
.green>.guide-label i{background:#32875f}
#studentView{position:fixed;inset:0;background:#c4e9f8}
.student-tools{position:absolute;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));display:flex;gap:6px;align-items:center;z-index:2}
.student-tools .button,.student-tools .icon-button{border:1px solid #8b8a8075;background:#fffef2eb;color:#323a43;box-shadow:0 2px 7px #24394710;min-height:40px}
.student-tools .icon-button{width:40px;height:40px}
body:has(#studentView:not([hidden])){overflow:hidden}
.notice{position:fixed;z-index:6;left:50%;bottom:18px;transform:translateX(-50%);max-width:min(90vw,640px);padding:10px 16px;border-radius:11px;background:#323344;color:#fff;font-weight:650;font-size:14px;box-shadow:0 4px 16px #2223}
.notice:empty{display:none}
.panel-title{display:flex;align-items:center;gap:9px;min-width:0}
.panel-title>[data-icon]{width:20px;height:20px;color:#626573}
.panel-title h2{font:400 23px/1.2 var(--display);letter-spacing:-.55px}
.guide-label{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:750;white-space:nowrap}
.guide-label i{width:7px;height:7px;flex:none;border-radius:50%}
.red .guide-label{color:#a13d39}.yellow .guide-label{color:#86620e}.green .guide-label{color:#30674c}
.switch-label input{position:absolute;opacity:0;height:1px;width:1px}
.switch-label input:focus-visible+.switch-track{outline:3px solid #9575e9;outline-offset:2px}
dialog{padding:0;border:1px solid var(--edge);border-radius:19px;background:#fff;color:var(--ink);width:min(620px,calc(100% - 24px));max-height:calc(100dvh - 32px);box-shadow:0 16px 84px #25283a35;overflow:auto}
dialog::backdrop{background:#26253b69}
.dialog-head,.dialog-foot{display:flex;justify-content:space-between;align-items:center;padding:15px 22px;background:#fff;position:sticky;z-index:1}
.dialog-head{top:0;border-bottom:1px solid var(--edge)}
.dialog-head .icon-button{border-color:transparent}
.dialog-body{padding:19px 22px 6px}
.dialog-body legend{font:400 21px var(--display)}
.settings-note{font-size:14px;color:var(--muted);margin:4px 0 10px}
.signal-config{display:grid;grid-template-columns:68px minmax(0,1fr) 68px 68px;align-items:end;gap:8px;padding:9px 11px;background:#faf9f6;border:1px solid var(--edge);border-radius:12px;margin:7px 0}
.signal-config>.guide-label{align-self:center}
.signal-config label{display:flex;flex-direction:column;gap:3px;color:#65656f;font-size:12px;font-weight:750}
.signal-config input{min-width:0;width:100%;border:1px solid #d8d6cf;border-radius:7px;background:#fff;min-height:34px;padding:4px 7px;font-size:15px;color:#353543}
.sound-settings{margin-top:17px}
.sound-row{display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid #eeece7;padding:10px 0}
.switch-label,.volume-label{display:flex;align-items:center;gap:7px;font-size:14px}
.switch-label{position:relative;font-weight:750;cursor:pointer}
.switch-label>[data-icon]{width:17px;height:17px;color:#676776}
.switch-track{display:inline-block;width:36px;height:21px;background:#a6a4ac;border-radius:18px;margin-left:2px;position:relative}
.switch-track::after{content:"";position:absolute;left:3px;top:3px;width:15px;height:15px;background:#fff;border-radius:50%;box-shadow:0 1px 3px #0002}
.switch-label input:checked+.switch-track{background:var(--purple)}
.switch-label input:checked+.switch-track::after{left:18px}
.volume-label{color:var(--muted)}
.volume-label input{width:clamp(88px,16vw,135px);accent-color:var(--purple);margin:0}
.volume-label output{min-width:3em;text-align:right;font-variant-numeric:tabular-nums}
.music-picker{display:flex;flex-wrap:wrap;align-items:center;gap:7px 12px;margin:10px 0 2px;padding:10px 12px;background:#f8f6fc;border:1px solid #e7e0f0;border-radius:10px}
.track-choice{min-width:0;flex:1 1 140px;display:grid;gap:2px}
.track-choice>span{font-size:12px;font-weight:700;color:#6d6379}
.track-choice strong{font-size:14px;overflow-wrap:anywhere;line-height:1.35}
.track-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.file-button{display:inline-flex;position:relative;overflow:hidden;border-radius:7px}
.file-button>input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.file-button>span,.track-tools button{display:inline-flex;justify-content:center;align-items:center;min-height:32px;padding:5px 9px;font-size:13px;font-weight:700}
.file-button>span{width:100%;border:1px solid #d9cdef;border-radius:7px;background:#fff;color:#57399e}
.file-button:focus-within{outline:3px solid #9575e9;outline-offset:2px}
.track-tools button{border:1px solid transparent;color:#625675;border-radius:7px}
.track-tools button:hover{background:#eee8f6}
#musicFileStatus{flex-basis:100%;margin:0;color:#63536d;font-size:13px}
#musicFileStatus:empty{display:none}
.settings-error{font-size:14px;color:#a72d32;margin-top:7px;font-weight:700}
.settings-error:empty{margin:0}
.dialog-foot{bottom:0;justify-content:flex-end;border-top:1px solid var(--edge);margin-top:10px}
@container (max-aspect-ratio:1/1){
  .stage:is([data-phase=paused],[data-phase=ended]) .stage-content{flex-direction:column}
  .stage:is([data-phase=paused],[data-phase=ended]) .stage-copy{text-align:center}
  .stage-symbol{width:23cqw;height:23cqw}
  .stage[data-phase=ready] .stage-content{align-items:start;justify-items:start;padding:12cqh 7cqw 0}
  .stage[data-phase=ready] .stage-copy{width:90%}
  .stage[data-phase=ready] .stage-title{font-size:22cqw}
  .stage[data-phase=ready] .stage-action{font-size:5.5cqw}
}
@media(max-aspect-ratio:1/1){
  .stage[data-phase=ready]{background-position:80% bottom;background-size:auto 55%;background-color:#c1e9fa}
}
@media(max-width:1050px){
  .topbar-inner{gap:10px;padding:7px 12px;min-height:58px}
  .brand{padding-right:10px}.brand strong{font-size:19px}
  .button{padding:9px 10px}.setup-tools,.transport,.screen-tools{gap:5px}
}
@media(max-width:880px){
  .topbar-inner{display:grid;grid-template-columns:minmax(0,1fr);row-gap:6px}
  .brand,.setup-tools{grid-area:1/1}.transport,.screen-tools{grid-area:2/1}
  .brand,.transport{justify-self:start}.brand{border:0;padding:0}.brand img{width:29px;height:29px}
  .setup-tools,.screen-tools{justify-self:end}.screen-tools{margin:0}
}
@media(max-width:540px){
  .topbar-inner{padding:6px 8px;gap:5px 4px}
  .brand{gap:5px}.brand strong{font-size:17px;letter-spacing:-1.1px}
  .topbar .button{min-height:35px;font-size:13px;padding:7px 9px;gap:4px}
  .topbar .button>[data-icon]{width:15px;height:15px}
  .duration-row{--time-width:4.05rem;font-size:12px;margin:0;gap:4px}
  .duration-input{min-height:35px;padding:1px 3px;border-radius:8px}
  .panel-title h2{font-size:21px}
  .dialog-body{padding:14px 12px 6px}.dialog-head,.dialog-foot{padding:10px 13px}
  .signal-config{grid-template-columns:minmax(0,1fr) 66px 66px;gap:5px;padding:7px 8px}
  .signal-config>.guide-label{grid-column:1/-1}
  .settings-note,.volume-label,.switch-label{font-size:13px}.sound-row{gap:5px}
  .volume-label input{width:80px}
}
@media(max-width:410px){
  #previewFullscreen span{display:none}
  #previewFullscreen{width:35px}
}
@media(max-width:365px){
  .brand img{display:none}
  .topbar .button{padding:7px}
  #end>[data-icon]{display:none}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
