
:root{color-scheme:light;--paper:#f6eedf;--ink:#453025;--line:#b3a089;--cream:#fffbf3;--peach:#f9c29d;--sage:#ced0af;--muted:#604a3b}
*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--paper);font:16px/1.55 Pretendard,sans-serif}header{width:min(1100px,calc(100% - 48px));margin:auto;padding:18px 0;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{color:inherit;text-decoration:none;font-size:25px;font-weight:700;letter-spacing:-.04em;min-height:44px;display:flex;align-items:center}nav{display:flex;gap:8px}nav button{font-size:14px;padding:8px 12px}main{width:min(1040px,calc(100% - 48px));margin:auto;padding:6px 0 40px}h1,h2,h3,p,figure{margin-top:0}h1{font:700 clamp(34px,4.5vw,46px)/1.15 Gaegu,Pretendard,sans-serif;margin-bottom:8px;text-wrap:balance}.theme-badge{display:inline-block;margin:0 0 6px;padding:3px 10px;border-radius:999px;background:#f2e4cc;border:1px solid #d4bfa4;font:700 13px/1.3 Pretendard,sans-serif;color:#604a3b}h2{font:700 30px/1.2 Gaegu,Pretendard,sans-serif;margin-bottom:12px}h3{font:700 26px/1.2 Gaegu,Pretendard,sans-serif;margin-bottom:8px}#intro{max-width:70ch;margin-bottom:12px}.notice{font-size:14px;margin:6px 0 12px}.notice:empty,.error:empty{display:none}.privacy{font-size:13px;max-width:75ch;margin:26px 0 0;color:var(--muted)}.setup-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:42px;align-items:start}.setup-layout form,.setup-layout aside{min-width:0}.setup-art{margin:20px 0 24px}.setup-art img{display:block;width:100%;height:auto;aspect-ratio:2;object-fit:contain}.setup-caption{font:700 26px/1.25 Gaegu,Pretendard,sans-serif;text-align:center;margin:12px auto;max-width:26ch}.how{border-top:1px solid var(--line);padding-top:18px}.how p{font-size:15px;max-width:60ch}.how h2{font-size:25px}.count-setting{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:10px}.count-setting label{margin:0}label{display:block;font-weight:700;margin-bottom:6px}.stepper{display:flex;align-items:center;gap:6px;width:172px;max-width:100%;flex:none}input{min-width:0;min-height:44px;background:var(--cream);border:1.5px solid var(--line);border-radius:8px;color:inherit;font:inherit;padding:7px 10px;caret-color:var(--ink)}input[type=number]{text-align:center;font-variant-numeric:tabular-nums}.stepper input{width:64px;padding:7px 0}.stepper button{padding:7px;min-width:44px}.input-caption{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-top:10px}.input-caption label{margin-bottom:5px}.input-caption span{font-size:13px;color:var(--muted)}textarea{width:100%;min-height:156px;height:164px;resize:vertical;color:inherit;background:var(--cream);border:1.5px solid var(--line);border-radius:8px;padding:10px;font:inherit;line-height:1.55;caret-color:var(--ink)}.hint{font-size:14px;color:var(--muted);margin:6px 0 12px;max-width:72ch}.role-settings{margin-top:20px}.role-heading{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.role-heading h2{margin:0;font-size:27px}.role-heading span{font-size:13px}.role-labels,.role-row{display:grid;grid-template-columns:minmax(0,1fr) 74px 44px;gap:8px;align-items:center}.role-labels{font-size:13px;color:var(--muted);margin:8px 0 5px}.role-row{margin-bottom:8px}.role-row input{width:100%}.role-row button{padding:6px;min-width:44px}.role-row label{margin:0}.role-row svg{width:17px;height:17px}.role-tools{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}.role-tools button{font-size:14px;padding:7px 10px}.total{font-size:14px;margin:10px 0 0;font-variant-numeric:tabular-nums}.total.invalid{color:#8a2f25}.error{color:#8a2f25;min-height:1.5em;margin:8px 0;font-size:15px;overflow-wrap:anywhere}button{border:1.5px solid var(--ink);border-radius:9px 12px 10px 8px;background:#f8eacf;color:inherit;font:inherit;padding:9px 15px;min-height:46px;min-width:46px;display:inline-flex;justify-content:center;align-items:center;line-height:1.4;cursor:pointer}button.primary{background:var(--peach);font-weight:700}button.secondary{background:var(--sage)}button:hover{filter:brightness(.97)}button:disabled{opacity:.55;cursor:default}[hidden]{display:none!important}.actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0 0}.actions .primary{min-width:170px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.stage-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px}.stage-top h2{margin-bottom:4px}.progress{font-size:14px;color:var(--muted);margin-bottom:0;font-variant-numeric:tabular-nums}.stage-top .actions{margin:0}.camp-stage{height:215px;position:relative;overflow:hidden;margin:10px 0 16px;border-bottom:1px solid var(--line)}.trail{position:absolute;bottom:24px;left:6%;width:88%;height:3px;border-bottom:2px dashed #b3a089;transform:rotate(-1deg)}.wagon{position:absolute;bottom:22px;left:calc(50% - 90px);width:210px;max-width:50%;height:auto;transform-origin:55% 90%}.mascot{position:absolute;object-fit:contain;width:105px;height:110px;bottom:20px;left:calc(50% - 180px)}.delivery-mascot{left:auto;right:calc(50% - 230px);width:88px}.speech{position:absolute;top:6px;left:50%;transform:translateX(-50%);background:#fbf3e1;border:1.5px solid #b3a089;border-radius:46% 40% 45% 35% / 28% 35% 30% 40%;padding:8px 22px;text-align:center;font:700 24px/1.2 Gaegu,Pretendard,sans-serif;max-width:94%;width:max-content}.speech:after{content:'';position:absolute;bottom:-8px;left:45%;width:12px;height:12px;border-bottom:1.5px solid #b3a089;border-right:1.5px solid #b3a089;transform:skewY(25deg) rotate(36deg);background:#fbf3e1}.camp-stage.arriving .wagon{animation:arrive 1.8s cubic-bezier(.16,1,.3,1) both}.camp-stage.arriving .mascot{animation:walk-in 1.8s cubic-bezier(.16,1,.3,1) both}.camp-stage.bump .wagon{animation:bump .7s ease-out both}.camp-stage.bump .delivery-mascot{animation:surprise .7s ease-out}.camp-stage.delivering .delivery-mascot{animation:carry 1.1s ease-out}.camp-stage.done .mascot{animation:cheer .6s ease-out}.paused *,.page-hidden *{animation-play-state:paused!important}.camp-stage .pebble{position:absolute;bottom:22px;left:56%;width:19px;height:10px;border:1.5px solid #7c6452;background:#d5c9b5;border-radius:45% 60% 40% 30%;transform:rotate(-8deg)}
@keyframes arrive{from{translate:190px 0}to{translate:0 0}}@keyframes walk-in{from{translate:190px 0}to{translate:0 0}}@keyframes bump{0%{rotate:0deg}25%{rotate:-7deg;translate:0 -8px}60%{rotate:3deg}100%{rotate:0deg;translate:0 0}}@keyframes surprise{30%{translate:0 -12px}100%{translate:0 0}}@keyframes carry{0%{translate:0 0}45%{translate:28px -6px}100%{translate:0 0}}@keyframes cheer{30%{translate:0 -8px}70%{translate:0 0}85%{translate:0 -3px}100%{translate:0 0}}
.role-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin:20px 0}.role-result{min-width:0;position:relative;padding-top:12px;border-top:2px solid var(--line)}.role-result:nth-child(3n+1){border-color:#a57a5b}.role-result:nth-child(3n+2){border-color:#7d8661}.role-result:nth-child(3n){border-color:#6f8094}.role-result h3{overflow-wrap:anywhere}.role-result .role-meta{font-size:13px;color:var(--muted);margin:0 0 9px}.role-result ul{list-style:none;margin:0;padding:0}.role-result li{padding:7px 0;border-bottom:1px solid #ddcfbb;overflow-wrap:anywhere;font-size:17px}.role-result li span{display:inline;font-size:12px;color:var(--muted);margin-left:6px;white-space:nowrap}.role-result.pending{min-height:126px}
.role-result.pending.next-pending{border-top-width:4px;border-bottom:2px dashed var(--line);padding-bottom:10px}.pending-message{font-size:14px;color:var(--muted)}
.role-result.pending.next-pending .pending-message{display:inline-block;padding:2px 8px;border:1px solid currentColor;border-radius:4px;font-weight:700;color:var(--ink,inherit)}.parcel{display:inline-block;position:relative;width:45px;height:32px;background:#e8c4a2;border:1.5px solid var(--ink);border-radius:10px 8px 7px 11px;margin:6px 0}.parcel:before{content:'';position:absolute;top:-5px;left:18px;width:10px;height:8px;border:1.5px solid var(--ink);border-radius:8px;background:#e8c4a2}.parcel:after{content:'';position:absolute;top:7px;left:18px;width:15px;height:16px;border:1px solid #8c725a;background:#fffbf3;rotate:-12deg}.result-heading{display:flex;align-items:center;justify-content:space-between;gap:18px}.result-heading img{width:165px;height:95px;object-fit:contain}.result-heading h2{margin-bottom:5px}.result-heading p{margin:0}.share-status{font-size:14px;margin:12px 0}.export-preview{display:block;max-width:min(600px,100%);height:auto;margin-top:16px;border:1px solid var(--line)}.download-link{display:inline-block;min-height:44px;color:inherit;padding:10px 0}.copy-fallback{height:160px;margin-top:12px}.result-help{font-size:14px;color:var(--muted);margin-top:18px}
dialog{max-width:min(470px,calc(100% - 28px));color:var(--ink);background:var(--paper);border:1.5px solid var(--ink);border-radius:12px;padding:22px}dialog::backdrop{background:#45302566}dialog form{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px}dialog p{overflow-wrap:anywhere}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #5b7157;outline-offset:3px}::selection{background:#e3b38f;color:#302016}::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-thumb{background:#b3a089;border:3px solid var(--paper);border-radius:8px}::-webkit-scrollbar-track{background:var(--paper)}
@media(min-width:1500px){main{width:min(1200px,calc(100% - 64px))}header{width:min(1260px,calc(100% - 64px))}.setup-layout{grid-template-columns:1fr 1fr;gap:64px}.setup-art{margin-top:42px}.camp-stage{height:250px}.role-board{gap:34px}}
@media(max-width:800px){.setup-layout{grid-template-columns:1fr;gap:20px}.setup-layout aside{order:-1}.setup-art{display:flex;align-items:center;gap:16px;margin:0}.setup-art img{width:160px;height:90px;flex:none}.setup-caption{text-align:left;font-size:23px;margin:0;max-width:25ch}.how{display:none}.setup-layout{gap:16px}.role-board{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.camp-stage{height:200px}.speech{font-size:22px}.stage-top{align-items:flex-start;flex-direction:column;gap:12px}}
@media(max-width:500px){header,main{width:calc(100% - 32px)}header{padding:10px 0}main{padding-top:4px}nav{gap:6px}nav button{padding:8px;font-size:13px}.brand{font-size:24px}h1{font-size:34px}#intro{font-size:15px;margin-bottom:8px}.setup-art img{width:130px;height:76px}.setup-caption{font-size:21px}.count-setting{gap:8px}.count-setting label{font-size:15px}.stepper{width:158px}.stepper input{width:58px}.stepper button{min-width:42px}.role-settings{margin-top:16px}textarea{height:100px}.role-labels,.role-row{grid-template-columns:minmax(0,1fr) 66px 44px;gap:6px}.role-board{grid-template-columns:1fr;gap:20px;margin:18px 0}.role-result{padding-top:10px}.role-result.pending{min-height:96px}.role-result h3{margin-bottom:4px}.role-result li{padding:6px 0}.role-result ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.actions{gap:8px}.actions button{padding:9px 11px}.stage-top .actions{width:100%}.stage-top .actions button{flex:1}.camp-stage{height:185px;margin-bottom:8px}.wagon{width:170px;left:calc(50% - 73px)}.mascot{width:76px;height:90px;left:calc(50% - 135px)}.delivery-mascot{left:auto;right:0;width:70px}.speech{font-size:20px;padding:7px 14px}.result-heading{gap:8px}.result-heading img{width:100px;height:75px}.result-heading h2{font-size:29px}.result-heading p{font-size:14px}.privacy{margin-top:24px}}
@media(max-width:360px){h1{font-size:31px}.setup-art img{width:100px;height:65px}.setup-caption{font-size:20px}.role-result ul{grid-template-columns:1fr}.input-caption span{font-size:12px}.count-setting{align-items:flex-start}.count-setting label{max-width:100px;padding-top:8px}.speech{font-size:19px}.result-heading img{width:80px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}


.role-result { --pin-ink:#87563a; }
.role-result:nth-child(3n+2) { --pin-ink:#5c6a42; }
.role-result:nth-child(3n) { --pin-ink:#4c6177; }
.role-result li { position:relative; padding-inline-start:17px; }
.role-result li .nametag-pin {
  position:absolute;
  inset-inline-start:1px;
  top:50%;
  transform:translateY(-50%);
  width:8px;
  height:8px;
  margin:0;
  border:1px solid var(--pin-ink);
  border-radius:50%;
  background:var(--pin-ink);
  box-shadow:inset 0 0 0 1px #fff3dd;
}
.role-result li .nametag-pin::after {
  content:"";
  position:absolute;
  width:1px;
  height:4px;
  top:5px;
  left:2px;
  background:var(--pin-ink);
  transform:rotate(30deg);
}
@media (prefers-reduced-motion:no-preference) {
  .role-result.pin-now .nametag-pin { animation:pin-tag .3s cubic-bezier(.16,1,.3,1); }
}
@keyframes pin-tag {
  from { opacity:.35; transform:translateY(-6px) rotate(-28deg); }
  to { opacity:1; transform:translateY(0) rotate(0); }
}

@media (min-width: 740px) and (max-width: 800px) and (min-height: 600px) {
  .setup-layout { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 26px; }
  .setup-layout aside { order: initial; }
  .setup-art { display: block; margin-bottom: 18px; }
  .setup-art img { width: 100%; height: auto; }
  .setup-caption { margin: 8px auto 0; text-align: center; }
}

@media (min-width: 1200px) {
  body[data-tm-game-ui="camp-role"][data-tm-selector-ui] :is(header, main) { max-width: 1480px; }
  .setup-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  body[data-tm-game-ui="camp-role"] main #app:has(>.camp-stage) {
    grid-template-columns: minmax(380px, 1fr) minmax(0, 1.55fr);
  }
  body[data-tm-game-ui="camp-role"] main #camp-stage { height: 248px; }
  body[data-tm-game-ui="camp-role"] main .camp-stage .wagon { width: 225px; left: calc(50% - 95px); }
  body[data-tm-game-ui="camp-role"] .camp-stage .mascot:not(.delivery-mascot) { left: calc(50% - 165px); }
  body[data-tm-game-ui="camp-role"] main .camp-stage .delivery-mascot { right: max(4px, calc(50% - 220px)); }
}

@media (min-width: 960px) and (max-width: 1099px) and (min-height: 600px) {
  #app:has(>.camp-stage) {
    display: grid;
    grid-template-columns: minmax(365px, 1fr) minmax(0, 1.3fr);
    gap: 16px 28px;
    align-items: start;
  }
  .stage-top { grid-column: 1 / -1; }
  #app:has(>.camp-stage) > :is(.camp-stage, .role-board) { margin: 0; }
  #app:has(>.camp-stage) > .role-board { grid-column: 2; grid-row: 2; }
  .camp-stage .delivery-mascot { right: max(4px, calc(50% - 230px)); }
}

body[data-tm-game-ui="camp-role"][data-tm-selector-ui] .page-heading {
  display: block;
  text-align: left;
  margin-bottom: 16px;
}
body[data-tm-game-ui="camp-role"][data-tm-selector-ui] .page-heading h1 {
  margin-bottom: 6px;
}
body[data-tm-game-ui="camp-role"][data-tm-selector-ui] .page-heading #intro {
  margin-bottom: 0;
}

@media (min-width: 801px) {
  body[data-tm-game-ui="camp-role"] .setup-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
  body[data-tm-game-ui="camp-role"] .setup-layout > aside {
    grid-column: 1;
    grid-row: 1;
  }
  body[data-tm-game-ui="camp-role"] .setup-layout > form {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 600px) {
  body[data-tm-game-ui="camp-role"] .setup-layout aside { order: 1; }
  body[data-tm-game-ui="camp-role"] #names { height: 6em; min-height: 5em; }
  body[data-tm-game-ui="camp-role"] #setup-actions {
    position: sticky;
    bottom: env(safe-area-inset-bottom, 0px);
    background: var(--paper, #f6eedf);
    padding-block: 4px;
    z-index: 2;
  }
  body[data-tm-game-ui="camp-role"] .stage-top .actions {
    display: flex;
    flex-wrap: wrap;
  }
  body[data-tm-game-ui="camp-role"] .stage-top .actions button {
    flex: 1 0 auto;
    min-width: 0;
    white-space: nowrap;
  }
}
