@font-face { font-family: "PL1"; src: url("fonts/Paperlogy-1Thin.woff2") format("woff2"); }
@font-face { font-family: "PL3"; src: url("fonts/Paperlogy-3Light.woff2") format("woff2"); }
@font-face { font-family: "PL5"; src: url("fonts/Paperlogy-5Medium.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "PL9"; src: url("fonts/Paperlogy-9Black.woff2") format("woff2"); font-display: swap; }

* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --k: #0b0b0c; --p: #f5f2ea; --y: #ffd21e; --r: #ff5136; --line: #cfc9ba; --mute: #5f5b52; --w: #fffdf8; }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--p); color: var(--k); font-family: "PL5", "Malgun Gothic", sans-serif; font-size: 18px; line-height: 1.5; word-break: keep-all; overflow-wrap: break-word; }
h1, h2 { font-family: "PL9", "Malgun Gothic", sans-serif; line-height: 1.15; font-weight: 400; }

header { background: var(--k); color: var(--p); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 14px 24px; }
h1 { font-size: 30px; }
.acts, .btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button, .go, select, input { font: inherit; color: inherit; }
button, a.go { border: 2px solid currentColor; background: transparent; border-radius: 99px; padding: 8px 18px; cursor: pointer; text-decoration: none; display: inline-block; }
button.go, a.go { background: var(--y); color: var(--k); border-color: var(--y); font-family: "PL9", sans-serif; }
button:disabled { opacity: 0.45; cursor: default; }
:focus-visible { outline: 4px solid var(--r); outline-offset: 2px; }

main { flex: 1 0 auto; width: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 24px; max-width: 1760px; margin: 0 auto; }
.view { position: sticky; top: 20px; align-self: start; }
.screen { position: relative; background: var(--k); border: 3px solid var(--k); border-radius: 12px; overflow: hidden; }
#stage { display: block; width: 100%; height: auto; aspect-ratio: 16/9; }
#bigplay { position: absolute; inset: 0; margin: auto; width: 132px; height: 132px; border: 0; background: var(--y); color: var(--k); font-family: "PL9", sans-serif; font-size: 30px; border-radius: 50%; padding: 0; }
.bar { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.bar button { min-width: 92px; background: var(--k); color: var(--p); border-color: var(--k); }
#seek { flex: 1; min-width: 60px; accent-color: var(--r); height: 32px; }
output { font-variant-numeric: tabular-nums; white-space: nowrap; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jump button { padding: 5px 14px; font-size: 17px; }
.tip, .note { color: var(--mute); font-size: 17px; margin-top: 12px; }

.first { background: var(--y); border-radius: 12px; padding: 20px 22px; }
.first .note { color: var(--k); }
h2 { font-size: 25px; margin-bottom: 12px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 14px; }
.row3 label { display: grid; gap: 4px; font-size: 17px; }
.row3 input, .row3 select { width: 100%; border: 2px solid var(--k); background: var(--w); border-radius: 8px; padding: 9px 12px; font-size: 20px; }
.act { margin-top: 30px; }
.act h2 { border-bottom: 3px solid var(--k); padding-bottom: 8px; margin-bottom: 4px; }
.ln { display: grid; grid-template-columns: 66px 1fr; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ln.on { background: #fff6cc; box-shadow: -8px 0 0 #fff6cc, 8px 0 0 #fff6cc; }
.tm { border: 0; padding: 8px 0; text-align: left; font-variant-numeric: tabular-nums; color: var(--mute); font-size: 17px; border-radius: 6px; }
.tm:hover { color: var(--k); text-decoration: underline; }
.ws { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws input { border: 2px solid var(--line); background: var(--w); border-radius: 8px; padding: 7px 10px; font-size: 19px; min-width: 3.2em; max-width: 100%; field-sizing: content; }
.ws input:focus { border-color: var(--k); }
.ws input.ed { border-color: var(--r); background: #fff; }
.ws input.empty { border-style: dashed; }
.ws .fx { color: var(--mute); padding: 7px 4px; }
.undo { border: 0; padding: 4px 8px; font-size: 17px; color: #b3230a; text-decoration: underline; border-radius: 6px; }
.long { flex-basis: 100%; font-size: 16px; color: #b3230a; }

footer { background: var(--k); color: #c9c4b8; font-size: 16px; margin-top: 48px; border-top: 6px solid var(--y); }
.fin { max-width: 1760px; margin: 0 auto; padding: 36px 24px 26px; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px 48px; align-items: start; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand img { border-radius: 12px; flex: none; }
.brand .name { font-family: "PL9", "Malgun Gothic", sans-serif; font-size: 21px; color: var(--p); line-height: 1.2; margin-bottom: 4px; }
footer a { color: var(--y); text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--p); }
.credit { display: grid; gap: 6px; }
.credit div { display: grid; grid-template-columns: 5.2em 1fr; gap: 8px; }
.credit dt { color: var(--p); font-family: "PL9", sans-serif; }
.notes { list-style: none; display: grid; gap: 8px; }
.notes li { padding-left: 18px; position: relative; }
.notes li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--r); }
.copy { max-width: 1760px; margin: 0 auto; padding: 14px 24px 22px; border-top: 1px solid #2a2a2c; font-size: 15px; color: #8d887d; }
dialog { margin: auto; border: 0; border-radius: 14px; padding: 28px 30px; width: min(520px, calc(100vw - 32px)); background: var(--p); color: var(--k); }
dialog::backdrop { background: #000a; }
fieldset { border: 0; margin-bottom: 14px; display: grid; gap: 6px; }
legend { font-family: "PL9", sans-serif; margin-bottom: 4px; }
fieldset label { display: flex; gap: 10px; align-items: center; }
input[type="radio"], input[type="checkbox"] { width: 22px; flex: none; height: 22px; accent-color: var(--r); }
progress { width: 100%; height: 26px; accent-color: var(--r); }
.btns { justify-content: flex-end; margin-top: 20px; }
.err { color: #b3230a; margin-top: 10px; }
[hidden] { display: none !important; }

@media (max-width: 1000px) {
  .fin { grid-template-columns: minmax(0, 1fr); padding: 28px 16px 20px; gap: 20px; }
  .copy { padding: 12px 16px 20px; }
  main { grid-template-columns: minmax(0, 1fr); padding: 0 16px 24px; gap: 18px; }
  .view { top: 0; z-index: 3; background: var(--p); padding: 12px 0 8px; }
  .tip, .jump { display: none; }
  header { padding: 12px 16px; }
  h1 { font-size: 25px; }
  #bigplay { width: 96px; height: 96px; font-size: 24px; }
}
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr; } .ln { grid-template-columns: 52px 1fr; } }
@media (max-height: 560px) and (max-width: 1000px) { .view { position: static; } }
