/* 주루마블 판 — 오버레이와 관리 페이지 미리보기가 함께 씁니다. */

.jm-stage {
  position: relative;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.jm-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

/* ---------------- 칸 ---------------- */

.jm-cell {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border-radius: var(--radius);
  border: 4px solid #fff;
  box-shadow: 0 4px 0 rgba(74, 54, 64, 0.18), 0 8px 18px rgba(74, 54, 64, 0.12);
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.jm-cell-label {
  white-space: pre-line;
  line-height: 1.15;
  word-break: keep-all;
}

.jm-cell-sub {
  opacity: 0.75;
  line-height: 1.1;
  white-space: pre-line;
}

.jm-cell-no {
  position: absolute;
  top: 4px;
  left: 6px;
  font: 700 14px/1 'Pretendard', sans-serif;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.is-hidden-cells .jm-cell {
  background: transparent !important;
  border-color: transparent;
  box-shadow: none;
}

.jm-cell.is-landed {
  transform: scale(1.08);
  z-index: 3;
  box-shadow: 0 0 0 6px var(--accent), 0 0 40px 10px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: jm-landed 0.9s ease-in-out infinite alternate;
}

.is-hidden-cells .jm-cell.is-landed {
  transform: none;
  border-color: var(--accent);
  border-width: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent) !important;
}

@keyframes jm-landed {
  from { box-shadow: 0 0 0 5px var(--accent), 0 0 24px 4px color-mix(in srgb, var(--accent) 60%, transparent); }
  to   { box-shadow: 0 0 0 8px var(--accent), 0 0 48px 16px color-mix(in srgb, var(--accent) 80%, transparent); }
}

/* 관리 페이지 편집 모드 */
.is-editor .jm-cell { cursor: pointer; }
.is-editor.is-hidden-cells .jm-cell { border: 3px dashed rgba(255, 60, 140, 0.9); }
.is-editor .jm-cell.is-selected {
  outline: 6px solid #2f7bff;
  outline-offset: 2px;
  z-index: 4;
}
.is-editor .jm-slot { outline: 3px dashed rgba(47, 123, 255, 0.55); outline-offset: -3px; }
.is-editor .jm-slot::before {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font: 700 34px/1.2 'Pretendard', sans-serif;
  color: rgba(47, 123, 255, 0.85);
  text-align: center;
  white-space: pre-line;
}

/* 칸 이미지 */
.jm-cell-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
}
.jm-cell.has-img { padding: 0; overflow: visible; }
.jm-cell.has-img .jm-cell-label,
.jm-cell.has-img .jm-cell-sub {
  position: relative;
  z-index: 1;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}
.jm-cell.has-img .jm-cell-label { margin-top: auto; margin-bottom: 8px; }

/* 결과 카드 속 칸 이미지 */
.jm-card-img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 20px;
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px var(--accent);
  margin: 6px 0 4px;
}

/* ---------------- 별 모으기 칸 ---------------- */

.jm-star {
  position: absolute;
  transform: translate(-50%, -50%);
  line-height: 1;
  z-index: 4;
  color: rgba(255, 255, 255, 0.55);
  -webkit-text-stroke: 2px rgba(74, 54, 64, 0.35);
  text-shadow: none;
  pointer-events: none;
  transition: color 0.3s;
}

.jm-star.on {
  color: #ffd23f;
  -webkit-text-stroke: 2px #e89b00;
  text-shadow: 0 0 10px rgba(255, 200, 40, 0.9), 0 2px 0 rgba(0, 0, 0, 0.15);
}

.jm-star.pop { animation: jm-star-pop 0.7s cubic-bezier(.2, 1.6, .4, 1); }

.jm-cell.is-stack-full .jm-star.on { animation: jm-star-flash 0.5s ease-in-out infinite alternate; }

@keyframes jm-star-pop {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-180deg); }
  70%  { transform: translate(-50%, -50%) scale(1.8) rotate(10deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes jm-star-flash {
  from { transform: translate(-50%, -50%) scale(1); }
  to   { transform: translate(-50%, -50%) scale(1.45); text-shadow: 0 0 22px #ffd23f, 0 0 40px #ffb300; }
}

.jm-stack-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #c47f00;
  white-space: nowrap;
}

/* ---------------- 말 ---------------- */

.jm-piece {
  position: absolute;
  z-index: 6;
  transition: left var(--hop, 260ms) cubic-bezier(.3, .7, .3, 1), top var(--hop, 260ms) cubic-bezier(.3, .7, .3, 1), opacity 0.35s;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.35));
}

.jm-piece > span,
.jm-piece > img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--ring);
  box-sizing: border-box;
  object-fit: cover;
  line-height: 1;
}

.jm-piece.is-hopping > span,
.jm-piece.is-hopping > img {
  animation: jm-hop var(--hop, 260ms) ease-out;
}

@keyframes jm-hop {
  0%   { transform: translateY(0) scale(1, 1); }
  45%  { transform: translateY(-38%) scale(0.95, 1.05); }
  85%  { transform: translateY(0) scale(1.08, 0.92); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* ---------------- 안쪽 3칸 ---------------- */

.jm-slot {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* 확정권만 있는 칸은 아래에 붙임 */
.jm-slot[data-kind='tickets'] { justify-content: flex-end; }

/* 위 기록 + 아래 확정권: 내용만큼만 차지하고, 기록은 위에·확정권은 아래에 붙어서 가운데가 비어 보이게 */
.jm-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--gap-x, 14px);
  height: 100%;
  min-height: 0;
}
.jm-stack .jm-panel-history { max-height: calc(var(--split, 0.55) * 100%); }

/* 왼쪽·오른쪽 패널은 바깥쪽에 붙이고 너비를 줄여서 가운데(캐릭터)가 덜 가려지게 */
.jm-slot-0 { align-items: flex-start; }
.jm-slot-2 { align-items: flex-end; }
.jm-slot-0 > :not(.jm-fx),
.jm-slot-2 > :not(.jm-fx) { width: calc(var(--pw, 1) * 100%); max-width: 100%; }

/* 현황판 + 확정권·할 일: 둘 다 내용만큼만, 확정권이 많으면 남는 높이까지 */
.jm-stack.jm-stack-st,
.jm-stack.jm-stack-mh { gap: 10px; }
.jm-stack.jm-stack-st { justify-content: flex-start; overflow: hidden; }
/* 별 모으기는 판 위 별로 보이니까 여기선 생략 → 확정권 자리 확보 */
.jm-stack-st [data-ref='stackbox'] { display: none !important; }
/* 타이머는 한 줄로: 이름 · 게이지 · 시간 */
.jm-stack-st .jm-timer { display: flex; align-items: center; gap: 10px; padding: 6px 14px; }
.jm-stack-st .jm-timer-label { flex: 0 1 auto; max-width: 42%; font-size: 19px; }
.jm-stack-st .jm-timer-row { flex: 1; margin-top: 0; min-width: 0; }
.jm-stack-st .jm-timer-time { font-size: 30px; }
.jm-stack-st > .jm-panel-status { flex: none; }
.jm-stack-st > .jm-timers { margin-top: 0; flex: none; }
.jm-stack-st > .jm-timers:empty { display: none; }
.jm-stack.jm-stack-st > .jm-panel-tickets { flex: 0 1 auto; max-height: none; min-height: 0; }

/* 메뉴판 + 주사위 기록 */
.jm-stack.jm-stack-mh { justify-content: flex-start; overflow: hidden; }
.jm-stack.jm-stack-mh > .jm-panel-history { flex: 0 1 auto; max-height: none; min-height: 0; }

/* ---------- 현황판: 지금 여기 (맨 위 강조) ---------- */
/* 왼쪽 몰기(현황+확정권 / 전부)에서는 현황판 패널 껍데기를 없애고 제목 리본 + 지금 여기 카드만 */
.jm-stack-st > .jm-panel-status,
.jm-stack-all > .jm-panel-status {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
.jm-stack-st .jm-panel-title.jm-status-title,
.jm-stack-all .jm-panel-title.jm-status-title {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin: 0 0 -8px 6px;
  padding: 2px 14px 4px 10px;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
  color: var(--accent);
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(40, 20, 30, 0.22);
  transform: rotate(-2deg);
}
.jm-stack-st .jm-here,
.jm-stack-all .jm-here {
  margin-bottom: 0;
  padding-top: 10px;
  border: 3px solid #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), 0 8px 18px rgba(40, 20, 30, 0.25);
}
.jm-stack-st .jm-here + .jm-row,
.jm-stack-all .jm-here + .jm-row { margin-top: 6px; }
.jm-panel-title.jm-status-title { font-size: 19px; margin-bottom: 6px; }
.jm-here {
  position: relative;
  border-radius: 16px;
  padding: 6px 14px 10px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #fff));
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.jm-here::after {
  content: '';
  position: absolute;
  right: -18px;
  top: -18px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.jm-here-label { display: block; font-size: 16px; opacity: 0.9; }
.jm-here > b {
  display: block;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.jm-here > b.is-new { animation: jm-here-pop 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes jm-here-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.jm-here-mission {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: jm-mission-blink 1.2s ease-in-out infinite alternate;
}
.jm-here + .jm-row { border-top: none; }

/* ---------- 주사위 기록: 대기 개수·다음 순서 ---------- */
.jm-qbadge {
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
}
.jm-qbadge b { font-weight: 400; font-size: 24px; line-height: 1.1; }
.jm-qbadge.is-zero { background: color-mix(in srgb, var(--accent) 18%, #fff); color: var(--accent); }
.jm-hnext { display: flex; align-items: baseline; gap: 8px; margin: -2px 2px 6px; min-width: 0; flex: none; }
.jm-hnext > span { flex: none; font-size: 15px; opacity: 0.55; }
.jm-hnext .jm-next { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: block; }
.jm-hnext .jm-next i { font-style: normal; opacity: 0.4; }
.jm-stack-mh .jm-history li { padding: 5px 10px 5px 6px; gap: 8px; }
.jm-stack-mh .jm-history p { font-size: 19px; line-height: 1.3; }
.jm-stack-mh .jm-history time { display: none; }
.jm-h-tag {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 16px;
  line-height: 1.45;
  vertical-align: 1px;
}
.jm-stack-mh .jm-history .jm-ava { width: 38px; height: 38px; }
.jm-stack-mh .jm-history .jm-ava i { font-size: 18px; }

/* ---------- 메뉴판: 패널 없이 리본 + 가격표 ---------- */
.jm-menuboard { flex: none; display: flex; flex-direction: column; gap: 6px; }
.jm-menu-title {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px 4px;
  padding: 3px 18px 5px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--accent);
  color: #fff;
  font-size: 25px;
  border: 3px solid #fff;
  box-shadow: 0 6px 14px rgba(40, 20, 30, 0.25);
  transform: rotate(-2deg);
}
.jm-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.jm-menu li {
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #fff;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 14px rgba(40, 20, 30, 0.2);
}
.jm-menu .jm-price {
  flex: none;
  width: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, #fff);
  border-right: 2px dashed color-mix(in srgb, var(--accent) 45%, #fff);
}
.jm-menu .jm-price small { font-size: 15px; margin-top: 6px; }
.jm-menu li > span {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 7px 12px;
  font-size: 19px;
  line-height: 1.25;
  word-break: keep-all;
}

/* ---------- 확정권·할 일: 종류별로 한 줄 (🛡️ 쉴드권  딸기우유 · 바닐라라떼 ×2) ---------- */
.jm-tickets li.jm-tkind {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 5px 12px;
  border-radius: 14px;
}
.jm-tk-head { flex: none; color: var(--accent); font-size: 20px; white-space: nowrap; }
.jm-tk-names { flex: 1 1 0; min-width: 40%; display: flex; flex-wrap: wrap; gap: 0 4px; font-size: 18px; }
.jm-tk-name {
  position: relative;
  white-space: nowrap;
  animation: jm-pop-in 0.45s cubic-bezier(.2, 1.4, .4, 1);
  transition: opacity 0.35s, max-width 0.35s;
  max-width: 12em;
}
.jm-tk-name + .jm-tk-name::before { content: '·'; margin-right: 4px; opacity: 0.45; }
.jm-tk-x { font-weight: 400; color: var(--accent); margin-left: 2px; font-size: 0.85em; }
.jm-tk-name.is-bump { animation: jm-pop-in 0.45s cubic-bezier(.2, 1.4, .4, 1); }
.jm-tickets li.jm-tkind.is-task .jm-tk-head { opacity: 0.9; }
.jm-tickets li.jm-tkind.is-task { border-style: dashed; }
/* 이름 하나 수행 완료: 작은 도장 → 줄 긋고 → 빠짐 */
.jm-tk-name .jm-t-stamp {
  right: 50%;
  top: 50%;
  padding: 0 6px;
  border-width: 2px;
  border-radius: 6px;
  font-size: 14px;
  font-style: normal;
  white-space: nowrap;
  transform: translate(50%, -50%) rotate(-12deg) scale(2.4);
}
.jm-tk-name.is-done .jm-tk-nick { text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.5; }
.jm-tk-name.is-done .jm-t-stamp,
.jm-tk-name.is-ping .jm-t-stamp { animation: jm-bstamp 0.35s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.jm-tk-name.is-leaving { opacity: 0; max-width: 0; overflow: hidden; }
@keyframes jm-bstamp {
  from { opacity: 0; transform: translate(50%, -50%) rotate(-12deg) scale(2.4); }
  to   { opacity: 1; transform: translate(50%, -50%) rotate(-12deg) scale(1); }
}
/* 많아지면 자동으로 한 단계씩 작게 */
.jm-panel-tickets.dense-1 .jm-tickets { gap: 3px; }
.jm-panel-tickets.dense-1 li.jm-tkind { padding: 2px 10px; }
.jm-panel-tickets.dense-1 .jm-tk-head { font-size: 18px; }
.jm-panel-tickets.dense-1 .jm-tk-names { font-size: 16px; }
.jm-panel-tickets.dense-2 .jm-tk-head { font-size: 16px; }
.jm-panel-tickets.dense-2 .jm-tk-names { font-size: 14px; }
.jm-panel-tickets.dense-3 .jm-tk-head { font-size: 14px; }
.jm-panel-tickets.dense-3 .jm-tk-names { font-size: 12px; }

/* 한 칸에 전부 (왼쪽에 몰기): 지금 여기 → 타이머 → 주사위 기록(짧게) → 확정권·할 일(남는 높이 전부) */
.jm-stack.jm-stack-all { justify-content: flex-start; overflow: hidden; gap: 8px; }
.jm-stack-all > .jm-panel-status { flex: none; }
.jm-stack-all .jm-row { padding: 4px 2px; }
.jm-stack-all .jm-row > b { font-size: 21px; }
.jm-stack-all > .jm-timers { margin-top: 0; gap: 6px; flex: none; }
.jm-stack-all > .jm-timers:empty { display: none; }
.jm-stack-all .jm-timer { display: flex; align-items: center; gap: 10px; padding: 5px 12px; }
.jm-stack-all .jm-timer-label { flex: 0 1 auto; max-width: 42%; font-size: 18px; }
.jm-stack-all .jm-timer-row { flex: 1; margin-top: 0; min-width: 0; }
.jm-stack-all .jm-timer-time { font-size: 28px; }
/* 별 모으기는 판 위 별로 보이니까 생략 */
.jm-stack-all [data-ref='stackbox'] { display: none !important; }
.jm-stack-all > .jm-panel-history { max-height: none; flex: none; padding: 8px 12px 10px; }
.jm-stack.jm-stack-all > .jm-panel-tickets { max-height: none; flex: 0 1 auto; min-height: 0; padding: 8px 12px 10px; }
.jm-stack-all .jm-panel-title { font-size: 22px; margin-bottom: 6px; }
.jm-stack-all .jm-here > b { font-size: 40px; }
.jm-stack-all .jm-history { gap: 4px; }
.jm-stack-all .jm-history li { padding: 2px 8px 2px 3px; gap: 6px; }
.jm-stack-all .jm-hnext { margin-bottom: 4px; }
.jm-stack-all .jm-history p { font-size: 17px; line-height: 1.3; }
.jm-stack-all .jm-history time { display: none; }
.jm-stack-all .jm-history .jm-ava { width: 28px; height: 28px; border-width: 2px; }
.jm-stack-all .jm-history .jm-ava i { font-size: 15px; }
.jm-stack-all .jm-h-tag { font-size: 14px; }

.jm-stack .jm-panel-tickets { max-height: calc((1 - var(--split, 0.55)) * 100% - var(--gap-x, 14px)); }

.jm-panel {
  flex: 0 1 auto;
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 25%, transparent), 0 10px 24px rgba(40, 20, 30, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.95);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 확정권이 없으면 제목 한 줄로 접힘 */
.jm-panel-tickets.is-empty { padding-bottom: 12px; }
.jm-panel-tickets.is-empty .jm-tickets,
.jm-panel-tickets.is-empty .jm-more { display: none; }
.jm-panel-tickets.is-empty .jm-panel-title { margin-bottom: 0; }
.jm-panel-tickets.is-empty .jm-empty { display: none !important; }
.jm-panel-tickets.is-empty .jm-panel-title small::after { content: '없음'; }

.jm-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 25px;
  color: var(--accent);
  margin-bottom: 8px;
  white-space: nowrap;
  flex: none;
}

.jm-panel-title small {
  margin-left: auto;
  font-size: 17px;
  color: var(--ink);
  opacity: 0.55;
}

/* 프로필 사진 */
.jm-ava {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 22%, #fff);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.jm-ava i {
  font-style: normal;
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.jm-ava img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.jm-ava.has-img img { opacity: 1; }
.jm-ava.has-img i { visibility: hidden; }
.jm-ava.emoji { background: #fff; }
.jm-ava.sm { width: 34px; height: 34px; border-width: 2px; }
.jm-ava.sm i { font-size: 18px; }
.jm-ava.lg { width: 110px; height: 110px; border-width: 5px; box-shadow: 0 0 0 4px var(--accent); }
.jm-ava.lg i { font-size: 50px; }

/* 기록 */
.jm-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.jm-history li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  animation: jm-pop-in 0.45s cubic-bezier(.2, 1.4, .4, 1);
  flex: none;
}

.jm-history li:first-child {
  background: color-mix(in srgb, var(--accent) 20%, #fff);
}

.jm-history p {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  word-break: keep-all;
  min-width: 0;
}

.jm-history b { font-weight: 400; color: var(--accent); }
.jm-history em { font-style: normal; color: var(--accent); }

.jm-history time {
  font: 600 15px/1 'Pretendard', sans-serif;
  opacity: 0.45;
  margin-left: 8px;
  white-space: nowrap;
}

.jm-empty, .jm-empty-li {
  margin: 2px 0;
  font-size: 18px;
  opacity: 0.45;
  text-align: center;
  list-style: none;
  background: none !important;
  animation: none !important;
}

/* 확정권 */
.jm-tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.jm-more {
  flex: none;
  margin-top: 6px;
  text-align: center;
  font-size: 20px;
  color: var(--accent);
}

.jm-tickets li {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  border: 3px solid transparent;
  box-sizing: border-box;
  animation: jm-pop-in 0.45s cubic-bezier(.2, 1.4, .4, 1);
  transition: height 0.45s ease, padding 0.45s ease, margin 0.45s ease, opacity 0.35s ease, transform 0.45s ease, border-color 0.2s;
}

.jm-t-nick {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jm-t-badge {
  flex: none;
  font-size: 18px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  border: 2px solid color-mix(in srgb, var(--accent) 45%, #fff);
  white-space: nowrap;
}

.jm-t-stamp {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg) scale(2.4);
  padding: 2px 14px;
  border: 4px solid #e5484d;
  border-radius: 10px;
  color: #e5484d;
  background: rgba(255, 255, 255, 0.92);
  font-size: 24px;
  opacity: 0;
  pointer-events: none;
}

/* 수행 완료: 도장 쾅 → 줄 긋기 → 접히며 사라짐 */
.jm-tickets li.is-done {
  border-color: #e5484d;
  background: #fff;
}
.jm-tickets li.is-done .jm-t-stamp {
  animation: jm-stamp 0.35s cubic-bezier(.3, 1.6, .5, 1) forwards;
}
.jm-tickets li.is-done .jm-t-nick,
.jm-tickets li.is-done .jm-t-badge {
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  opacity: 0.45;
  transition: opacity 0.3s;
}
.jm-tickets li.is-leaving {
  height: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -8px;
  opacity: 0;
  transform: translateX(-40px) scale(0.9);
  overflow: hidden;
}

@keyframes jm-stamp {
  from { opacity: 0; transform: translateY(-50%) rotate(-12deg) scale(2.4); }
  to   { opacity: 1; transform: translateY(-50%) rotate(-12deg) scale(1); }
}

/* 현황 (짧게) */
.jm-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.jm-chip {
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  padding: 6px 12px 8px;
  min-width: 0;
}
.jm-chip span { display: block; font-size: 16px; opacity: 0.6; }
.jm-chip b { display: block; font-weight: 400; font-size: 34px; line-height: 1.1; color: var(--accent); white-space: nowrap; }

.jm-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 4px;
  border-top: 2px dashed color-mix(in srgb, var(--accent) 22%, transparent);
  min-width: 0;
}
.jm-row > span { flex: none; font-size: 17px; opacity: 0.65; }
.jm-row.jm-row-first { border-top: none; padding-top: 0; }
/* 주사위 대기 · 현재 칸 나란히 */
.jm-row.jm-row-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: baseline; }
.jm-row-pair > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.jm-row-pair span { flex: none; font-size: 17px; opacity: 0.65; }
.jm-row-pair b { font-weight: 400; font-size: 24px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jm-row > b { font-weight: 400; font-size: 24px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jm-row .jm-tcounts { font-size: 19px; gap: 2px 10px; }
.jm-row .jm-next { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.jm-row .jm-next i { font-style: normal; opacity: 0.4; }
.jm-row.jm-mission {
  border-top: none;
  margin-top: 2px;
  border-radius: 12px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--accent) 16%, #fff);
}
.jm-row.jm-mission > span { opacity: 0.8; }
.jm-row.jm-mission > b { animation: jm-mission-blink 1.2s ease-in-out infinite alternate; }
@keyframes jm-mission-blink { from { opacity: 1; } to { opacity: 0.55; } }

/* 예전 현황 칸 스타일 (다른 곳에서 재사용) */
.jm-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.jm-stat {
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  padding: 10px 14px;
  min-width: 0;
}

.jm-stat.wide { grid-column: 1 / -1; }

.jm-stat-label {
  font-size: 19px;
  opacity: 0.6;
}

.jm-stat-value {
  font-size: 42px;
  line-height: 1.15;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jm-stat-value.small { font-size: 32px; }

.jm-tcounts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 24px;
}
.jm-tcounts b { font-weight: 400; color: var(--accent); }

.jm-next {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: 22px;
}

.jm-next li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}

.jm-next li b { color: var(--accent); font-weight: 400; }

/* ---------------- 타이머 (현황 아래) ---------------- */

.jm-timers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--gap-x, 12px);
  flex: none;
}

.jm-timer {
  border-radius: var(--radius);
  background: var(--panel-bg);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 25%, transparent), 0 10px 24px rgba(40, 20, 30, 0.22);
  padding: 10px 14px 12px;
  animation: jm-pop-in 0.45s cubic-bezier(.2, 1.4, .4, 1);
}

.jm-timer-label { font-size: 21px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 게이지 막대 오른쪽에 남은 시간 */
.jm-timer-row { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.jm-timer-time { flex: none; font-weight: 400; font-size: 38px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }

.jm-timer-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, #fff);
  overflow: hidden;
}
.jm-timer-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s linear; }

.jm-timer.is-paused { opacity: 0.7; }
.jm-timer.is-hurry .jm-timer-time { color: #e5484d; animation: jm-tick 0.5s ease-in-out infinite alternate; }
.jm-timer.is-hurry .jm-timer-bar i { background: #e5484d; }
.jm-timer.is-done { border-color: var(--accent); }
.jm-timer.is-done .jm-timer-time { animation: jm-tick 0.35s ease-in-out infinite alternate; }

@keyframes jm-tick {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

/* ---------------- 주사위·결과 카드 ---------------- */

.jm-fx {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border-radius: 26px;
  transition: background 0.3s;
}

.jm-fx.is-on { background: rgba(255, 255, 255, 0.35); }

.jm-dice-wrap {
  position: absolute;
  perspective: 900px;
  width: 170px;
  height: 170px;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(.2, 1.5, .4, 1);
}

.jm-dice-wrap.is-on {
  opacity: 1;
  transform: scale(1);
}

.jm-dice {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.jm-face {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border-radius: 26px;
  background: #fff;
  border: 6px solid var(--accent);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 20px;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.06);
  backface-visibility: hidden;
}

.jm-face i {
  width: 30px;
  height: 30px;
  margin: auto;
  border-radius: 50%;
  background: var(--accent);
  visibility: hidden;
}

.jm-face i.on { visibility: visible; }
.jm-face.f1 i.on { background: #ff3b5c; width: 40px; height: 40px; }

.jm-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  max-width: 620px;
  box-sizing: border-box;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  border-radius: 30px;
  background: #fff;
  border: 6px solid var(--accent);
  box-shadow: 0 10px 0 color-mix(in srgb, var(--accent) 45%, transparent), 0 24px 50px rgba(74, 54, 64, 0.3);
  padding: 24px 22px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity 0.25s, transform 0.4s cubic-bezier(.2, 1.5, .4, 1);
}

.jm-card.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.jm-card .jm-ava { margin-bottom: 8px; }
.jm-card-emoji { font-size: 80px; line-height: 1.1; }
.jm-card-line { font-size: 30px; line-height: 1.3; word-break: keep-all; }
.jm-card-line b { font-weight: 400; color: var(--accent); }
.jm-card-line em { font-style: normal; color: var(--accent); }
.jm-card-main {
  font-size: 58px;
  line-height: 1.15;
  color: var(--accent);
  margin: 4px 0;
  word-break: keep-all;
  white-space: pre-line;
}
.jm-card-lap.star { background: #ffb800; }
.jm-card-lap.grant { background: #4d8dff; }
.jm-card-lap {
  margin-top: 10px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
}

@keyframes jm-pop-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}


/* ================================================================== *
 * 글자만 모드 (theme.plain): 패널 배경 없이 그림자 글씨 → 캐릭터를 최대한 안 가림
 *   흰 글씨 + 진한 테두리(번짐) — 어두운 배경·밝은 배경 어디서든 읽히게
 * ================================================================== */
.jm-stage.is-plain {
  --ol: color-mix(in srgb, var(--plain-ol, #3a162c) 92%, transparent);
  --fg: var(--plain-fg, #fff);
  --hi: var(--sub, color-mix(in srgb, var(--accent) 55%, #fff));
  --plain-shadow: 0 0 2px var(--ol), 0 0 3px var(--ol), 0 0 4px var(--ol), 0 2px 4px rgba(0, 0, 0, 0.55);
  --plain-shadow-lg: 0 0 3px var(--ol), 0 0 5px var(--ol), 0 0 7px var(--ol), 0 3px 8px rgba(0, 0, 0, 0.6);
}
.jm-stage.is-plain .jm-slot .jm-panel,
.jm-stage.is-plain .jm-slot .jm-timer {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
  color: var(--fg);
}
.jm-stage.is-plain .jm-slot .jm-panel,
.jm-stage.is-plain .jm-slot .jm-timer,
.jm-stage.is-plain .jm-menuboard { text-shadow: var(--plain-shadow); color: var(--fg); }
.jm-stage.is-plain .jm-stack { gap: 16px; }
/* 강조 글씨(닉네임·칸 이름·가격)는 연분홍 */
.jm-stage.is-plain .jm-history b,
.jm-stage.is-plain .jm-history em,
.jm-stage.is-plain .jm-tk-head,
.jm-stage.is-plain .jm-tk-x,
.jm-stage.is-plain .jm-tcounts b,
.jm-stage.is-plain .jm-row > b,
.jm-stage.is-plain .jm-more,
.jm-stage.is-plain .jm-timer-time,
.jm-stage.is-plain .jm-h-tag,
.jm-stage.is-plain .jm-menu .jm-price { color: var(--hi); }

/* 제목: 글씨 + 얇은 밑줄 */
.jm-stage.is-plain .jm-slot .jm-panel-title,
.jm-stage.is-plain .jm-slot .jm-panel-title.jm-status-title,
.jm-stage.is-plain .jm-menu-title {
  align-self: flex-start;
  margin: 0 0 6px;
  padding: 0 2px 3px;
  background: none;
  border: none;
  box-shadow: none;
  transform: none;
  color: var(--hi);
  font-size: 23px;
  border-bottom: 3px solid var(--hi);
  border-radius: 0;
  text-shadow: var(--plain-shadow);
}
.jm-stage.is-plain .jm-panel-title small { opacity: 0.9; color: var(--fg); font-size: 17px; }

/* 지금 여기: 카드 없이 큰 글씨 */
.jm-stage.is-plain .jm-here,
.jm-stage.is-plain .jm-stack-st .jm-here,
.jm-stage.is-plain .jm-stack-all .jm-here {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-top: -2px;
  color: var(--fg);
  overflow: visible;
}
.jm-stage.is-plain .jm-here::after { display: none; }
.jm-stage.is-plain .jm-here-label { font-size: 17px; opacity: 1; }
.jm-stage.is-plain .jm-here > b,
.jm-stage.is-plain .jm-stack-all .jm-here > b {
  font-size: 48px;
  line-height: 1.15;
  color: var(--fg);
  text-shadow: var(--plain-shadow-lg), 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent);
  overflow: visible;
}
.jm-stage.is-plain .jm-here-mission {
  margin-top: 2px;
  background: var(--accent);
  color: #fff;
  text-shadow: none;
  font-size: 17px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.jm-stage.is-plain .jm-row { border-top: none; }
.jm-stage.is-plain .jm-row > span { opacity: 0.9; }

/* 기록: 줄 배경 없이 */
.jm-stage.is-plain .jm-history { gap: 2px; }
.jm-stage.is-plain .jm-history li,
.jm-stage.is-plain .jm-history li:first-child { background: none; padding: 1px 0; }
.jm-stage.is-plain .jm-history li:not(:first-child) { opacity: 0.8; }
.jm-stage.is-plain .jm-history p { font-size: 19px; }
.jm-stage.is-plain .jm-h-tag { background: none; padding: 0 1px; font-size: 1em; text-shadow: var(--plain-shadow); }
.jm-stage.is-plain .jm-qbadge { text-shadow: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.jm-stage.is-plain .jm-qbadge.is-zero { background: var(--accent); color: #fff; opacity: 0.8; }
.jm-stage.is-plain .jm-hnext > span,
.jm-stage.is-plain .jm-history time,
.jm-stage.is-plain .jm-empty,
.jm-stage.is-plain .jm-empty-li { opacity: 0.85; }
.jm-stage.is-plain .jm-hnext .jm-next { font-size: 17px; }

/* 확정권·할 일: 줄 배경 없이 */
.jm-stage.is-plain .jm-tickets { gap: 2px; }
.jm-stage.is-plain .jm-tickets li.jm-tkind { background: none; border: none; padding: 1px 0; }
.jm-stage.is-plain .jm-tk-head { font-size: 20px; }
.jm-stage.is-plain .jm-tk-names { font-size: 19px; }
.jm-stage.is-plain .jm-tk-name + .jm-tk-name::before { opacity: 0.8; }
.jm-stage.is-plain .jm-t-stamp { text-shadow: none; }
.jm-stage.is-plain .jm-panel-tickets.dense-1 .jm-tk-head { font-size: 18px; }
.jm-stage.is-plain .jm-panel-tickets.dense-1 .jm-tk-names { font-size: 17px; }
.jm-stage.is-plain .jm-panel-tickets.dense-2 .jm-tk-head,
.jm-stage.is-plain .jm-panel-tickets.dense-3 .jm-tk-head { font-size: 16px; }
.jm-stage.is-plain .jm-panel-tickets.dense-2 .jm-tk-names,
.jm-stage.is-plain .jm-panel-tickets.dense-3 .jm-tk-names { font-size: 15px; }

/* 메뉴판: 가격표 배경 없이 */
.jm-stage.is-plain .jm-menu { gap: 0; }
.jm-stage.is-plain .jm-menu li { background: none; border: none; box-shadow: none; overflow: visible; }
.jm-stage.is-plain .jm-menu .jm-price {
  width: 78px;
  justify-content: flex-end;
  padding-right: 10px;
  background: none;
  border-right: none;
}
.jm-stage.is-plain .jm-menu li > span { padding: 3px 0; font-size: 20px; }

/* 타이머: 글씨 + 얇은 게이지 */
.jm-stage.is-plain .jm-stack-st .jm-timer,
.jm-stage.is-plain .jm-stack-all .jm-timer { padding: 0; }
.jm-stage.is-plain .jm-timer-bar { height: 10px; background: rgba(255, 255, 255, 0.35); box-shadow: 0 0 0 2px var(--ol); }
.jm-stage.is-plain .jm-timer-time { text-shadow: var(--plain-shadow-lg); }

/* 글자만 모드 · 왼쪽 몰기: 타이머도 다른 제목(주사위 기록 등)과 같은 줄 모양으로
 *   ⏱ 냥냥체 ─────            4:09
 *   [━━━━━━━━━━━━━━━━━━━━━━━]           */
.jm-stage.is-plain .jm-stack-st .jm-timer,
.jm-stage.is-plain .jm-stack-all .jm-timer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 10px;
  row-gap: 6px;
  padding: 0;
}
.jm-stage.is-plain .jm-stack-st .jm-timer-row,
.jm-stage.is-plain .jm-stack-all .jm-timer-row { display: contents; }
.jm-stage.is-plain .jm-stack-st .jm-timer-label,
.jm-stage.is-plain .jm-stack-all .jm-timer-label {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  max-width: 100%;
  padding: 0 2px 3px;
  font-size: 24px;
  color: var(--hi);
  border-bottom: 3px solid var(--hi);
}
.jm-stage.is-plain .jm-stack-st .jm-timer-time,
.jm-stage.is-plain .jm-stack-all .jm-timer-time { grid-column: 2; grid-row: 1; font-size: 34px; line-height: 1; padding-bottom: 2px; }
.jm-stage.is-plain .jm-stack-st .jm-timer-bar,
.jm-stage.is-plain .jm-stack-all .jm-timer-bar { grid-column: 1 / -1; grid-row: 2; height: 10px; }

/* 글자만 모드: 현황판을 조금 더 크게 (제목·지금 여기·수행 중) */
.jm-stage.is-plain .jm-slot .jm-panel-title,
.jm-stage.is-plain .jm-menu-title { font-size: 24px; }
.jm-stage.is-plain .jm-slot .jm-panel-title.jm-status-title { font-size: 26px; }
.jm-stage.is-plain .jm-here-label { font-size: 19px; }
.jm-stage.is-plain .jm-here > b,
.jm-stage.is-plain .jm-stack-all .jm-here > b { font-size: 58px; line-height: 1.12; }
.jm-stage.is-plain .jm-here-mission { font-size: 19px; padding: 3px 14px; margin-top: 4px; }

/* 글자만 모드: 왼쪽 칸 제목 밑줄을 모두 칸 너비 끝까지 → 줄이 딱 맞게 */
.jm-stage.is-plain .jm-slot .jm-panel-title,
.jm-stage.is-plain .jm-slot .jm-panel-title.jm-status-title,
.jm-stage.is-plain .jm-menu-title { align-self: stretch; }
/* 타이머 제목줄도 같은 밑줄 (이름 + 시간 아래로 한 줄) */
.jm-stage.is-plain .jm-stack-st .jm-timer,
.jm-stage.is-plain .jm-stack-all .jm-timer { column-gap: 0; }
.jm-stage.is-plain .jm-stack-st .jm-timer-label,
.jm-stage.is-plain .jm-stack-all .jm-timer-label { justify-self: stretch; align-self: stretch; display: flex; align-items: flex-end; }
.jm-stage.is-plain .jm-stack-st .jm-timer-time,
.jm-stage.is-plain .jm-stack-all .jm-timer-time { padding: 0 2px 3px 10px; border-bottom: 3px solid var(--hi); }

/* 확정권·할 일: 종류 이름 칸 너비를 고정 → 이름들이 세로로 줄 맞춰 시작 */
.jm-stage.is-plain .jm-tickets li.jm-tkind { flex-wrap: nowrap; }
.jm-tk-head { overflow: hidden; text-overflow: ellipsis; }
.jm-stage.is-plain .jm-tk-head { flex: 0 0 6.6em; width: 6.6em; }
.jm-stage.is-plain .jm-tk-names { flex: 1 1 auto; min-width: 0; }

/* 글자만 모드: 확정권 자리를 더 주려고 간격 줄이기 + "수행 중"을 "지금 여기" 줄 오른쪽에 */
.jm-stage.is-plain .jm-stack { gap: 10px; }
.jm-stage.is-plain .jm-slot .jm-panel-title { margin-bottom: 4px; }
.jm-stage.is-plain .jm-here {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}
.jm-stage.is-plain .jm-here-label { grid-column: 1; grid-row: 1; }
.jm-stage.is-plain .jm-here > b { grid-column: 1 / -1; grid-row: 2; }
.jm-stage.is-plain .jm-here-mission { grid-column: 2; grid-row: 1; justify-self: end; margin-top: 0; }
.jm-stage.is-plain .jm-stack-st .jm-timer,
.jm-stage.is-plain .jm-stack-all .jm-timer { row-gap: 5px; }

/* 잠시 멈춤이면 대기 뱃지에 ⏸ */
.jm-qbadge.is-hold::before { content: '⏸'; margin-right: 2px; }
