*,
:before,
::before,
:after,
::after {
  box-sizing: border-box;
}

* {
  border: 0;
  border-radius: 0;
  margin: 0;
  outline: 0;
  padding: 0;
}

html,
body {
  overflow: hidden;
}

body {
  background: #3a3a3a;
  color: #ededed;
  font-family: BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
  font-size: 0;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  border: 0;
}

ol,
ul {
  list-style: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font-family: inherit;
}

button {
  background-color: transparent;
  cursor: pointer;
}

input[type=file],
input[type=checkbox] {
  display: none;
}

::-webkit-scrollbar {
  display: none;
}

.TierMaker {
  --color-font: #ededed;
  --color-group-header-font: #9a9a9a;
  --color-input-border: #a5a5a5;
  --color-input-background: #3c3c3c;
  --color-icon: #adadad;
  --color-panel-background: #363636;
  --color-panel-header-background: #323232;
  --color-panel-border: #303030;
  --color-body-background: #3a3a3a;
  --color-selected: #575757;
  --color-item-selected: #393939;
  --chip-size: 56px;
  --row-height: 72px;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--color-body-background);
  color: var(--color-font);
  font-family: BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

.Stage {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: auto;
  padding: 88px 32px 48px;
}
.Stage[data-file-over] {
  outline: 2px dashed var(--color-input-border);
  outline-offset: -16px;
}

.Board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 780px;
  margin: auto;
}

.BoardTitle {
  width: 100%;
  background: transparent;
  font-size: 22px;
  line-height: 34px;
  font-weight: 500;
  color: var(--color-font);
}
.BoardTitle:focus {
  outline: none;
}

.TierTable {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
  background: var(--color-panel-header-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 12px 8px 8px 8px;
  overflow: hidden;
}

.TierRow {
  display: flex;
  min-height: var(--row-height);
  border-radius: 2px;
  overflow: hidden;
}
.TierRow-Label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  padding: 2px;
  overflow: hidden;
  background: var(--row-color);
  color: var(--row-text-color);
  font-size: var(--row-font-size);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
  user-select: none;
}
.TierRow-Label[data-font=sans] {
  font-family: BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
}
.TierRow-Label[data-font=serif] {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Times New Roman", serif;
}
.TierRow-Label[data-font=mono] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.TierRow-Label[data-font=rounded] {
  font-family: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "Yu Gothic", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
}
.TierRow-Body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--row-color) 55%, #4f4f4f);
  transition: background 0.15s;
}
.TierRow-Hint {
  display: none;
  font-size: 11px;
  color: var(--color-group-header-font);
  user-select: none;
}
.TierRow[data-over] .TierRow-Body {
  background: color-mix(in srgb, var(--row-color) 72%, #4f4f4f);
}
.TierRow[data-selected] .TierRow-Label {
  box-shadow: inset 0 0 0 2px var(--color-font);
}

.TierMaker[data-dragging] .TierRow[data-empty] .TierRow-Hint {
  display: block;
}

.Chip {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--chip-size);
  height: var(--chip-size);
  background: var(--color-panel-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 2px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.Chip:active {
  cursor: grabbing;
}
.Chip[data-selected] {
  box-shadow: inset 0 0 0 2px var(--color-input-border);
}
.Chip[data-dragging] {
  opacity: 0.25;
}
.Chip-Image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.Chip-Shape {
  width: 60%;
  height: 60%;
  pointer-events: none;
}

.DropCaret {
  flex-shrink: 0;
  align-self: center;
  width: 2px;
  height: calc(var(--chip-size) - 8px);
  background: var(--color-font);
  border-radius: 1px;
}
.DropCaret[data-hidden] {
  display: none;
}

.DragGhost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}
.DragGhost[data-hidden] {
  display: none;
}

.Pool {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--chip-size) + 24px);
  padding: 12px;
  background: var(--color-panel-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 8px;
  transition: background 0.15s;
}
.Pool[data-over] {
  background: var(--color-selected);
}
.Pool-Empty {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-group-header-font);
  user-select: none;
}

.Logo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 28px;
}
.Logo a {
  color: var(--color-font);
  font-family: "Rubik Iso", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
  font-size: 22px;
  line-height: 2;
  text-decoration: none;
}

.PanelControl {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 32px;
}
.PanelControl-Item {
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 21px;
  color: var(--color-group-header-font);
  cursor: pointer;
  user-select: none;
}
.PanelControl-Item[data-open] {
  color: var(--color-font);
}

.PanelColumn {
  position: absolute;
  left: 0;
  top: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.Panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: max-content;
  background: var(--color-panel-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 12px 8px 8px 8px;
  overflow: hidden;
}
.Panel[data-panel]:not([data-open]) {
  display: none;
}
.Panel[data-float] {
  position: fixed;
}
.Panel-Header {
  flex-shrink: 0;
  height: 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}
.Panel-Header:active {
  cursor: grabbing;
}
.Panel-CloseIcon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-icon);
  cursor: pointer;
}
.Panel-CloseIcon svg {
  visibility: hidden;
}
.Panel-CloseIcon:hover svg {
  visibility: visible;
}
.Panel-Title {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--color-panel-header-background);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-font);
  border-bottom-right-radius: 12px;
}
.Panel-Title[data-end] {
  padding: 0 16px;
}
.Panel-Main {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior-y: none;
  scrollbar-width: none;
}
.Panel-Handle {
  position: absolute;
}
.Panel-Handle[data-direction=n] {
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
}
.Panel-Handle[data-direction=s] {
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
}
.Panel-Handle[data-direction=e] {
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
}
.Panel-Handle[data-direction=w] {
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
}
.Panel-Handle[data-direction=ne] {
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}
.Panel-Handle[data-direction=nw] {
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.Panel-Handle[data-direction=se] {
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.Panel-Handle[data-direction=sw] {
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}

.TierMaker[data-fixed] .Panel {
  position: fixed;
  top: 56px;
  right: 0;
  left: auto;
}
.TierMaker[data-fixed] .Panel-Header {
  cursor: default;
}

.RightLabelGrid {
  display: grid;
  grid-template-columns: max-content 1fr;
  padding: 8px 12px;
}
.RightLabelGrid-Row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1/-1;
  align-items: center;
  min-height: 36px;
  column-gap: 8px;
}
.RightLabelGrid-Row-Label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-font);
  padding: 0 12px;
}

.NumberInput,
.TextInput,
.ColorGrid,
.ToggleInput {
  justify-self: start;
}

.NumberInput {
  display: flex;
  align-items: center;
}
.NumberInput-Arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--color-icon);
  cursor: pointer;
}
.NumberInput-Arrow[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.NumberInput-Field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Input {
  min-width: calc(2ch + 16px);
  max-width: calc(4ch + 16px);
  height: 24px;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--color-input-background);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  text-align: center;
}
.NumberInput-Input:focus {
  outline: none;
}
.NumberInput-Unit {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  user-select: none;
}

.TextInput {
  width: calc(8ch + 24px);
  height: 24px;
  padding: 0 8px;
  border-radius: 2px;
  background: var(--color-input-background);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
}
.TextInput:focus {
  outline: none;
}
.TextInput:disabled {
  opacity: 0.4;
  cursor: default;
}

.ToggleInput {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: center;
  gap: 6px 8px;
  padding: 6px 12px;
}
.ToggleInput-Option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  user-select: none;
}
.ToggleInput-Option[data-selected]::before, .ToggleInput-Option[data-selected]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  pointer-events: none;
}
.ToggleInput-Option[data-selected]::before {
  left: 0;
  border-left: 1px solid var(--color-icon);
  border-top: 1px solid var(--color-icon);
  border-bottom: 1px solid var(--color-icon);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}
.ToggleInput-Option[data-selected]::after {
  right: 0;
  border-right: 1px solid var(--color-icon);
  border-top: 1px solid var(--color-icon);
  border-bottom: 1px solid var(--color-icon);
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.ColorGrid {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
}
.ColorGrid-Swatch {
  width: 16px;
  height: 16px;
  background: var(--swatch-color);
  border-radius: 2px;
  cursor: pointer;
}
.ColorGrid-Swatch[data-selected] {
  box-shadow: 0 0 0 1px var(--color-panel-background), 0 0 0 2px var(--color-font);
}
.ColorGrid-Custom {
  position: relative;
  width: 16px;
  height: 16px;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  border-radius: 2px;
  cursor: pointer;
}
.ColorGrid-Custom::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  background: var(--swatch-color);
}
.ColorGrid-Custom[data-selected] {
  box-shadow: 0 0 0 1px var(--color-panel-background), 0 0 0 2px var(--color-font);
}

.ColorPicker {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}
.ColorPicker[data-hidden] {
  display: none;
}
.ColorPicker-Panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--color-panel-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 12px 8px 8px 8px;
  user-select: none;
}
.ColorPicker-Head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.ColorPicker-Title {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-font);
}
.ColorPicker-Close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-icon);
  cursor: pointer;
}
.ColorPicker-Ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, red, yellow, lime, aqua, blue, magenta, red);
  cursor: crosshair;
  touch-action: none;
}
.ColorPicker-Hole {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--color-panel-background);
  pointer-events: none;
}
.ColorPicker-RingKnob {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
}
.ColorPicker-Square {
  position: relative;
  width: 120px;
  height: 120px;
  background: linear-gradient(to bottom, transparent, #000000), linear-gradient(to right, #ffffff, var(--picker-pure));
  cursor: crosshair;
  touch-action: none;
}
.ColorPicker-SquareKnob {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
}
.ColorPicker-Foot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ColorPicker-Preview {
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-panel-border);
  border-radius: 2px;
}
.ColorPicker-Hex {
  flex: 1;
  height: 24px;
  padding: 0 8px;
  background: var(--color-input-background);
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
}
.ColorPicker-Hex:focus {
  outline: none;
}

.RowList {
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
}
.RowList-Empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: 12px;
  color: var(--color-group-header-font);
  user-select: none;
}

.RowItem {
  display: flex;
  align-items: center;
  height: 32px;
  border-radius: 2px;
  cursor: pointer;
}
.RowItem[data-selected] {
  background-color: var(--color-item-selected);
}
.RowItem-Color {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin: 0 10px;
  background: var(--row-color);
  border-radius: 2px;
}
.RowItem-Name {
  flex: 1;
  min-width: 96px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-font);
  user-select: none;
}
.RowItem-Remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-icon);
  cursor: pointer;
}

.ActionList {
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
}

.ActionItem {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-font);
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
}
.ActionItem:hover {
  background-color: var(--color-item-selected);
}
.ActionItem[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.ActionItem[data-disabled]:hover {
  background-color: transparent;
}

.TextBlock {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 260px;
  padding: 16px 18px;
}
.TextBlock h1 {
  color: var(--color-font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  text-align: center;
}
.TextBlock p {
  color: #d5d5d5;
  font-size: 13px;
  line-height: 21px;
}