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

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

.monster-compare-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(4, 1fr);
  margin: 20px auto;
  padding: 18px;
}

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

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

.monster-compare-field input,
.monster-compare-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-compare-field input:focus,
.monster-compare-field select:focus {
  border-color: #3f51b5;
  box-shadow: 0 0 0 2px rgba(63, 81, 181, .18);
  outline: none;
}

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

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

.monster-compare-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.monster-compare-card-header {
  align-items: flex-start;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 14px;
}

.monster-compare-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.monster-compare-title a {
  color: #283593;
  text-decoration: none;
}

.monster-compare-title a:hover,
.monster-compare-title a:focus {
  text-decoration: underline;
}

.monster-compare-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.monster-compare-version {
  min-width: 0;
  text-align: center;
}

.monster-compare-version + .monster-compare-version {
  border-left: 1px solid #eee;
}

.monster-compare-version-label {
  background: #f5f5f5;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 4px;
}

.monster-compare-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: 190px;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

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

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

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

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

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

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

.monster-compare-names {
  color: #666;
  font-size: 13px;
  line-height: 1.6;
  min-height: 20px;
  padding: 10px 14px 14px;
}

.monster-compare-pager {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 24px 0 8px;
}

.monster-compare-pager button {
  background: #3f51b5;
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  min-width: 92px;
  padding: 10px 14px;
}

.monster-compare-pager button:disabled {
  background: #bdbdbd;
  cursor: default;
}

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

.monster-compare-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-compare-dialog::backdrop {
  background: rgba(0, 0, 0, .55);
}

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

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

.monster-compare-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-compare-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .monster-compare-grid {
    grid-template-columns: 1fr;
  }
}
