
:root{color-scheme:light;--paper:#f6eedf;--ink:#453025;--line:#b3a089;--cream:#fffbf3;--peach:#f9c29d;--sage:#ced0af}
*{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:14px}.brand{color:inherit;text-decoration:none;font-size:25px;font-weight:700;letter-spacing:-.04em;min-height:44px;display:flex;align-items:center}main{width:min(1040px,calc(100% - 48px));margin:auto;padding:6px 0 40px}h1,h2,h3,p{margin-top:0}h1{font:700 clamp(34px,4.5vw,46px)/1.15 Gaegu,Pretendard,sans-serif;margin-bottom:8px;text-wrap:balance}h2{font:700 30px/1.2 Gaegu,Pretendard,sans-serif;margin-bottom:10px}.page-heading{display:flex;gap:20px;align-items:center;justify-content:space-between}.page-heading>div{min-width:0}.page-heading img{width:230px;height:132px;object-fit:contain;flex:none}#intro{max-width:68ch;margin-bottom:4px}.notice{font-size:14px;margin:6px 0;min-height:1.55em}.privacy{font-size:13px;max-width:75ch;margin:28px 0 0;color:#604a3b}.setup{max-width:700px}.count-setting{margin-bottom:18px}label{display:block;font-weight:700;margin-bottom:6px}.stepper{display:flex;align-items:center;gap:6px;max-width:260px}input{width:80px;flex:1;min-width:0;min-height:46px;text-align:center;background:var(--cream);border:1.5px solid var(--line);border-radius:8px;color:inherit;font:inherit}textarea{width:100%;min-height:120px;resize:vertical;color:inherit;background:var(--cream);border:1.5px solid var(--line);border-radius:8px;padding:10px;font:inherit;line-height:1.6;caret-color:var(--ink)}.hint{font-size:14px;color:#604a3b;margin:7px 0 12px;max-width:72ch}.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:.6;cursor:default}button[hidden],[hidden]{display:none!important}.actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0 0}.actions .primary{min-width:150px}.progress{font-variant-numeric:tabular-nums;margin-bottom:8px}.ticket-board{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;align-items:stretch;margin-top:20px}.ticket{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:4px;min-width:0;min-height:138px;background:#f9e7bf;border:1.5px dashed #8b725b;border-radius:7px 11px 8px 12px;padding:12px 10px;box-shadow:1px 3px 6px #4530250d;transition:background .15s}.ticket.open{background:#e1e4ce;border-style:solid}.ticket .name{font-weight:700;overflow-wrap:anywhere;max-width:100%}.ticket .number{font:700 36px/1 Gaegu,Pretendard,sans-serif}.ticket .tap{font-size:13px}.ticket .person-id{font-size:12px;color:#604a3b}.result-layout{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.3fr);gap:36px;align-items:start;margin-top:18px}.turn-progress{padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.current-name{font:700 34px/1.2 Gaegu,Pretendard,sans-serif;overflow-wrap:anywhere;margin:8px 0}.next-name{overflow-wrap:anywhere}.turn-progress h2{font-size:24px}.order-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px}.order-list li{display:flex;align-items:baseline;gap:9px;min-width:0;padding:6px 0;border-bottom:1px solid #d3c4ae}.order-list .rank{font:700 25px/1.2 Gaegu,Pretendard,sans-serif;min-width:30px;font-variant-numeric:tabular-nums}.order-list .name{overflow-wrap:anywhere;min-width:0}.order-list .person-id{font-size:12px;white-space:nowrap;color:#604a3b}.order-list .done{color:#604a3b}.order-list .current{font-weight:700;background:#e1e4ce}.order-list .done .name{text-decoration:line-through;text-decoration-color:#8b725b}.order-list .tag{font-size:12px;display:block}.result-layout section{min-width:0}.summary{margin-top:10px}.export-preview{max-width:100%;height:auto;border:1px solid var(--line);margin-top:14px}.export-download{display:inline-block;color:inherit;margin-top:8px;min-height:44px}.share-status{min-height:1.5em;font-size:14px}.silent-note{font-size:13px;color:#604a3b;margin-top:14px}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:1100px){.ticket-board.large{grid-template-columns:repeat(10,minmax(0,1fr));gap:8px}.ticket-board.large .ticket{min-height:105px;font-size:14px;padding:9px 6px}.ticket-board.large .number{font-size:29px}}
@media(max-width:700px){header,main{width:calc(100% - 32px)}header{padding:10px 0}main{padding-top:4px}.page-heading{gap:10px;align-items:flex-start}.page-heading img{width:112px;height:96px;margin-top:0}h1{font-size:34px}#intro{font-size:15px}.notice{margin:2px 0 6px}.setup{max-width:none}.ticket-board{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}.ticket{min-height:124px;padding:9px 7px;font-size:15px}.ticket .number{font-size:32px}.ticket .tap{font-size:12px}.result-layout{grid-template-columns:1fr;gap:24px;margin-top:12px}.order-list{gap:4px 12px}.current-name{font-size:30px}.turn-progress{padding:10px 0}.actions{gap:8px}.actions button{padding:9px 11px}.privacy{margin-top:24px}.result-layout .actions{margin-top:10px}}
@media(max-width:360px){.page-heading img{width:80px;height:80px}.page-heading{gap:6px}h1{font-size:30px}.ticket-board{grid-template-columns:repeat(2,minmax(0,1fr))}.order-list{grid-template-columns:1fr}.order-list .rank{min-width:24px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.notice:empty,.error:empty{display:none}

.ticket:not(.open) .name{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* Draw attention to the first unopened card without delaying interaction. */
@media (prefers-reduced-motion: no-preference) {
  .ticket.attention { animation: ticket-invitation 1.2s ease-in-out 2; }
  @keyframes ticket-invitation { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
}

/* A quiet, non-interactive hand points to an unopened ticket after inactivity. */
.tap-guide{position:absolute;right:5px;top:5px;width:38px;height:38px;pointer-events:none;z-index:1;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M16 24V9a3 3 0 0 1 6 0v10-3a3 3 0 0 1 6 0v3-1a3 3 0 0 1 6 0v3a3 3 0 0 1 6 0v8c0 9-5 14-13 14h-2c-5 0-8-2-11-6l-6-8c-2-3 2-6 4-4l4 3Z' fill='%23fff8e9' stroke='%23453025' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M10 8 7 5M15 5V1M21 6l3-3' fill='none' stroke='%23c47a55' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E")}
@media(prefers-reduced-motion:no-preference){.tap-guide{animation:guide-tap 1s ease-in-out 3}@keyframes guide-tap{0%,100%{transform:translate(5px,5px) rotate(-8deg)}50%{transform:translate(0,0) rotate(0)}}}


.ticket .tap,
.ticket .number {
  width: 100%;
  border-top: 1px dashed #8b725b;
  padding-top: 5px;
}
.ticket.open.last-opened {
  background: #f5dec2;
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink), 2px 4px 10px #4530251f;
}
.ticket.opened-now::after {
  content: "";
  position: absolute;
  inset: auto 7px 4px;
  height: 5px;
  border-top: 1px dashed #8b725b;
  background: #f9e7bf;
  pointer-events: none;
  animation: ticket-tear .28s ease-out both;
}
.partial-order {
  margin-top: 20px;
}
.partial-order h2 {
  font-size: 25px;
}
.order-list li.row-revealed-now {
  animation: ticket-row .58s .10s ease-out both;
}
@keyframes ticket-tear {
  0% { transform: none; }
  100% { opacity: 0; transform: translate(14px, 8px) rotate(7deg); }
}
@keyframes ticket-row {
  0%, 35% { box-shadow: inset 3px 0 #865f54, inset 0 -2px #865f54; }
  100% { box-shadow: inset 0 0 transparent; }
}

@media (min-width: 740px) and (min-height: 600px) {
  .setup {
    max-width: 720px;
    display: block;
  }
  .ticket-board {
    grid-template-columns: repeat(auto-fit, minmax(min(104px, 100%), 1fr));
  }
}

@media (min-width: 1200px) {
  body[data-tm-game-ui="ticket-order"][data-tm-selector-ui] :is(header, main) { max-width: 1480px; }
  body[data-tm-game-ui="ticket-order"] main .setup { max-width: 720px; }
  body[data-tm-game-ui="ticket-order"] .ticket-board:not(.large) {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    max-width: 1100px;
  }
}

/* Unified 2-column setup layout & gentle mascot animation */
@keyframes tm-mascot-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
#scene,
.setup-scene {
  animation: tm-mascot-float 3.6s ease-in-out infinite;
  will-change: transform;
}
main:has(.setup-layout) .page-heading #scene {
  display: none;
}
.setup-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
.setup-stage {
  background: #fbf4e6;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.setup-scene {
  display: block;
  width: min(100%, 220px);
  height: auto;
  object-fit: contain;
}
.setup-layout .setup {
  max-width: none;
  min-width: 0;
}
@media (min-width: 1024px) {
  .setup-layout {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
    gap: 36px;
  }
  .setup-stage {
    min-height: 320px;
    padding: 28px 24px;
  }
  .setup-scene {
    width: min(100%, 340px);
  }
  body[data-tm-game-ui="ticket-order"] main .setup-layout .setup {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .setup-stage { padding-block: 6px; }
  .setup-stage .setup-scene { width: min(100%, 152px); }
}

#turn-heading:focus-visible { outline: 3px solid #5b7157; outline-offset: 3px; }
