.monster-color-page {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 1040px;
  padding: 0 18px 48px;
  text-align: left;
}

.monster-color-intro,
.monster-color-note {
  line-height: 1.8;
  text-align: center;
}

.monster-color-controls {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
  display: grid;
  gap: 14px;
  grid-template-columns: 2fr repeat(3, 1fr);
  margin: 20px auto;
  padding: 18px;
}

.monster-color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monster-color-field label {
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.monster-color-field input,
.monster-color-field select {
  background: #fff;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 15px;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.monster-color-field input:focus,
.monster-color-field select:focus {
  border-color: #3f51b5;
  box-shadow: 0 0 0 2px rgba(63, 81, 181, .18);
  outline: none;
}

.monster-color-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
  text-align: center;
}

.monster-color-chip {
  background: #e8eaf6;
  border-radius: 999px;
  color: #283593;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
}

.monster-color-list {
  display: grid;
  gap: 20px;
}

.monster-color-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .18);
  min-width: 0;
  overflow: hidden;
}

.monster-color-card-header {
  border-bottom: 1px solid #eee;
  padding: 12px 16px;
}

.monster-color-card-header h2 {
  color: #283593;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
}

.monster-color-column-labels,
.monster-color-images,
.monster-color-names {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.monster-color-column-labels {
  background: #e8eaf6;
  color: #283593;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.monster-color-column-labels span {
  padding: 7px 4px;
}

.monster-color-column-labels span + span,
.monster-color-image-box + .monster-color-image-box,
.monster-color-name + .monster-color-name {
  border-left: 1px solid #eee;
}

.monster-color-version h3 {
  background: #f5f5f5;
  border-bottom: 1px solid #eee;
  border-top: 1px solid #eee;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding: 7px 12px;
  text-align: left;
}

.monster-color-image-box {
  align-items: center;
  background-color: #fafafa;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  display: flex;
  height: 150px;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.monster-color-image-box img {
  image-rendering: auto;
  max-height: 142px;
  max-width: 100%;
}

.monster-color-rotate {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 100%;
}

.monster-color-rotate:focus-visible {
  box-shadow: inset 0 0 0 3px #3f51b5;
  outline: none;
}

.monster-color-rotate-hint {
  background: rgba(0, 0, 0, .66);
  border-radius: 999px;
  bottom: 5px;
  color: #fff;
  font-size: 10px;
  left: 50%;
  opacity: 0;
  padding: 3px 7px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity .15s ease;
  white-space: nowrap;
}

.monster-color-rotate:hover .monster-color-rotate-hint,
.monster-color-rotate:focus-visible .monster-color-rotate-hint {
  opacity: 1;
}

.monster-color-missing {
  align-items: center;
  background: rgba(255, 255, 255, .85);
  color: #888;
  display: flex;
  font-size: 12px;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.monster-color-name {
  color: #666;
  font-size: 12px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px;
}

.monster-color-name strong,
.monster-color-name a,
.monster-color-name span {
  display: block;
}

.monster-color-name strong {
  color: #555;
  margin-bottom: 3px;
}

.monster-color-name a {
  color: #283593;
  font-weight: 700;
  text-decoration: none;
}

.monster-color-name a:hover,
.monster-color-name a:focus {
  text-decoration: underline;
}

.monster-color-name span {
  margin-top: 3px;
}

.monster-color-empty {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .12);
  color: #666;
  padding: 36px 20px;
  text-align: center;
}

.monster-color-dialog {
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
  max-width: calc(100vw - 40px);
  padding: 18px 18px 14px;
}

.monster-color-dialog::backdrop {
  background: rgba(0, 0, 0, .55);
}

.monster-color-dialog__close {
  background: transparent;
  border: 0;
  color: #666;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  position: absolute;
  right: 8px;
  top: 4px;
}

.monster-color-dialog__caption {
  font-size: 15px;
  font-weight: 700;
  margin: 0 28px 10px 0;
}

.monster-color-dialog__image {
  background-color: #fafafa;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  display: block;
  max-height: calc(100vh - 110px);
  max-width: calc(100vw - 76px);
}

@media (max-width: 760px) {
  .monster-color-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monster-color-field:first-child {
    grid-column: 1 / -1;
  }
}

