.endroll[data-making] {
  --mk-ink: #252143;
  --mk-muted: #554e73;
  --mk-accent: #5f42b4;
  --mk-paper: #f0ebff;
  color: var(--mk-ink);
  background: var(--mk-paper);
}
.mk-stage {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 24px;
  padding: 36px 64px;
  background: radial-gradient(circle, #5f42b421 1.5px, transparent 2px) 0 0 / 25px 25px, var(--mk-paper);
}
.mk-header { min-width: 0; }
.mk-label { margin: 0; font-size: 26px; font-weight: 800; color: var(--mk-muted); overflow-wrap: anywhere; }
.mk-header .mk-label { color: var(--mk-accent); }
.mk-topic { margin: 4px 0 0; font-size: 54px; line-height: 1.4; font-weight: 900; overflow-wrap: anywhere; }
.mk-body { display: grid; grid-template-columns: minmax(0, 1fr) 352px; min-height: 0; gap: 24px; }
.mk-sheet, .mk-current {
  min-width: 0;
  min-height: 0;
  border: 2px solid #d8cbef;
  border-radius: 22px;
}
.mk-sheet { display: flex; padding: 20px; background: var(--bg); border-color: var(--line); }
.mk-tier { flex: 1; min-width: 0; --rank-min: 18px; }
/* いま置いた札を示す枠は、写真の上にも出す。 */
.mk-tier .mk-active { outline: 3px solid #a58aef; outline-offset: -3px; }

/* 再生中の説明欄では、写真全体と名前を別々に見せる。 */
.endroll[data-making] .mk-current .mk-word.wimg {
  aspect-ratio: auto;
  border-radius: 7px;
}
.endroll[data-making] .mk-current .mk-word.wimg::after { content: none; }
.endroll[data-making] .mk-current .mk-word.wimg .wcap {
  position: static;
  display: block;
  padding: 0 3px;
  margin: 0;
  color: inherit;
  text-shadow: none;
  text-align: center;
  line-height: 1.12;
  overflow: visible;
  white-space: normal;
  line-break: anywhere;
}

.mk-current {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  padding: 22px;
  background: #e8dfff;
}
.mk-current .mk-label { font-size: 24px; line-height: 1.3; }
.mk-detail { display: grid; justify-items: start; gap: 4px; width: 100%; }
.mk-word { min-width: 0; max-width: 100%; font-size: 39px; line-height: 1.42; font-weight: 900; overflow-wrap: anywhere; }
.endroll[data-making] .mk-current .mk-word.wimg { width: min(100%, 248px); line-height: 1.12; }
.endroll[data-making] .mk-current .mk-word.wimg .wpic { height: 140px; background-size: contain; }
.endroll[data-making] .mk-current .mk-word.wimg .wcap { padding-top: 4px; font-size: 22px; line-height: 1.4; }
.mk-author { display: flex; align-items: center; gap: 10px; max-width: 100%; font-weight: 800; }
.mk-current .mk-author { font-size: 28px; }
.mk-author bdi { min-width: 0; overflow-wrap: anywhere; }
.mk-author .room-avatar { width: 36px; height: 36px; font-size: 18px; }
.mk-ranks { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 800; }
.mk-ranks .er-rank { font-size: 23px; overflow-wrap: anywhere; max-width: 100%; }
.mk-votes { min-width: 0; width: 100%; }
.mk-vote-list { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; font-size: 20px; line-height: 1.2; font-weight: 700; }
.mk-vote-list:has(bdi:nth-child(5)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  font-size: 17px;
  line-height: 1.35;
}
.mk-vote-list bdi { border-radius: 6px; background: #faf7ff; padding: 4px 7px; overflow-wrap: anywhere; max-width: 100%; }
.mk-total { font-size: 44px; line-height: 1.45; overflow-wrap: anywhere; }

.mk-body[data-roster=wide] { grid-template-columns: minmax(0, 1fr) 560px; }
.mk-body[data-roster=xl] { grid-template-columns: minmax(0, 1fr) 760px; }
.mk-current[data-final] { justify-content: flex-start; gap: 10px; overflow: hidden; }
.mk-current[data-final] .mk-total { font-size: 30px; line-height: 1.45; }
.mk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; margin: 0; }
.mk-stats > div, .mk-submitter { min-width: 0; border-radius: 10px; background: #f6f1ff; }
.mk-stats > div { padding: 6px 8px; }
.mk-stats dt { font-size: 14px; font-weight: 800; color: var(--mk-muted); overflow-wrap: anywhere; line-height: 1.4; }
.mk-stats dd { margin: 0; font-size: 28px; font-weight: 900; line-height: 1.4; }
.mk-current .mk-roster-head { font-size: 20px; }
.mk-roster { --mk-fit: 1; flex: 1 1 0; min-height: 0; width: 100%; overflow: hidden; }
.mk-roster-list {
  display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); align-content: start; gap: 4px;
  margin: 0; padding: 0; list-style: none;
}
.mk-roster-list[data-cols="1"] { --cols: 1; }
.mk-roster-list[data-cols="2"] { --cols: 2; }
.mk-roster-list[data-cols="3"] { --cols: 3; }
.mk-roster-list[data-cols="4"] { --cols: 4; }
.mk-roster-list[data-cols="5"] { --cols: 5; }
.mk-roster-list[data-cols="6"] { --cols: 6; }
.mk-roster-list[data-cols="4"] .mk-count, .mk-roster-list[data-cols="5"] .mk-count, .mk-roster-list[data-cols="6"] .mk-count { display: none; }
.mk-submitter { padding: 2px 8px; font-size: calc(21px * var(--mk-fit)); }
.mk-submitter .mk-author { line-height: 1.45; gap: 6px; }
.mk-submitter :is(.room-avatar, .av) { width: calc(24px * var(--mk-fit)); height: calc(24px * var(--mk-fit)); font-size: calc(14px * var(--mk-fit)); }
.mk-count { display: block; color: var(--mk-muted); font-size: calc(17px * var(--mk-fit)); font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }

.mk-footer { display: flex; align-items: center; gap: 16px; }
.mk-meter { flex: 1; min-width: 32px; height: 10px; border-radius: 99px; overflow: hidden; background: #dcd0f5; }
.mk-meter > span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--mk-accent); transform-origin: left; }
[dir=rtl] .mk-meter > span { transform-origin: right; }
.mk-counter { font-size: 26px; font-weight: 800; color: var(--mk-muted); font-variant-numeric: tabular-nums; }
.mk-controls { margin-inline-start: auto; display: flex; gap: 12px; }
.mk-controls .er-btn { min-width: 138px; border: 2px solid var(--mk-accent); border-radius: 14px; background: #fffaf2; color: var(--mk-ink); overflow-wrap: anywhere; line-height: 1.15; }
.mk-controls .er-btn:last-child { background: var(--mk-accent); color: white; }
.mk-controls .er-btn:focus-visible, body[data-pad] .mk-controls .er-btn:focus, body[data-input=key] .mk-controls .er-btn:focus { outline: 4px solid var(--mk-accent); outline-offset: 4px; }

.mk-logo { grid-column: 1 / -1; display: grid; place-content: center; justify-items: center; gap: 24px; text-align: center; }
.mk-logo :is(.er-thanks, .er-hint) { color: var(--mk-muted); overflow-wrap: anywhere; }
.mk-logo .er-game-logo { max-width: 100%; }
[data-making][data-phase=logo] .mk-header { visibility: hidden; }

.port.mk-stage { padding: 36px 44px; }
.port .mk-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
/* 幅390pxではゲームのスマホ盤と同じ約112pxの段名欄、文字は実寸12px以上。 */
.port .tier.board.mk-tier:has(.custom-rank-name) { --label-w: 310px; --rank-min: 34px; }
.port .mk-current { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.port .mk-detail { grid-row: span 2; }
.port .mk-logo { grid-row: 1 / -1; }
.port .mk-body[data-roster] { grid-template-columns: minmax(0, 1fr); }
.port .mk-body:has(.mk-current[data-final]) { grid-template-rows: minmax(0, 1fr) minmax(0, 44%); }
.port .mk-current[data-final] { display: flex; align-items: stretch; }
.port .mk-current[data-final] :is(.mk-label, .mk-total) { text-align: center; }
.port .mk-current[data-final] .mk-stats > div { text-align: start; }
.port .mk-current[data-final] .mk-detail { grid-row: auto; }
.port .mk-submitter { padding: 4px 8px; font-size: calc(24px * var(--mk-fit)); }
.port .mk-count { font-size: calc(20px * var(--mk-fit)); }
.port .mk-roster { min-height: 160px; }
.port .mk-footer { flex-wrap: wrap; }
.port .mk-controls { flex: 1 0 100%; justify-content: end; }

html.rm .mk-meter > span { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .mk-meter > span { visibility: hidden; } }

.port .mk-ranks .er-rank { font-size: 34px; }
