/* v2.51 Chaos scenario final-ruler surrender and unification result */

.chaos-unification-result {
  width: min(520px, calc(100vw - 28px));
  max-height: min(900px, calc(100dvh - 28px));
  overflow: auto;
  text-align: center;
}

.chaos-final-surrender {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: -2px 0 16px;
  padding: 18px 16px 20px;
  overflow: hidden;
  border: 1px solid rgba(205, 166, 90, .55);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 18%, rgba(213, 172, 86, .16), transparent 42%),
    linear-gradient(160deg, rgba(58, 43, 27, .96), rgba(13, 11, 9, .98));
  box-shadow: inset 0 0 0 1px rgba(255, 233, 181, .05), 0 16px 36px rgba(0, 0, 0, .48);
  animation: chaosSurrenderEnter .45s cubic-bezier(.2, .85, .3, 1.08) both;
}

.chaos-final-surrender::before,
.chaos-final-surrender::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 194, 119, .62));
}

.chaos-final-surrender::before { left: 12px; }
.chaos-final-surrender::after { right: 12px; transform: scaleX(-1); }

.chaos-surrender-kicker {
  color: #c7a560;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
}

.chaos-surrender-portrait-shell {
  position: relative;
  width: 132px;
  height: 156px;
  margin-top: 2px;
  padding: 5px;
  border: 1px solid #b9914d;
  border-radius: 12px 12px 16px 16px;
  background: linear-gradient(160deg, #7b5a2b, #241a10);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .62), inset 0 0 0 2px rgba(255, 228, 163, .08);
}

.chaos-surrender-portrait-shell::after {
  content: '降';
  position: absolute;
  right: -11px;
  bottom: -10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid #e1bf74;
  border-radius: 50%;
  background: radial-gradient(circle, #8d2f24, #3b1511 72%);
  color: #ffe3a0;
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .6);
}

.chaos-surrender-portrait-shell img,
.chaos-surrender-portrait-fallback {
  width: 100%;
  height: 100%;
  border-radius: 8px 8px 12px 12px;
  object-fit: cover;
  object-position: 50% 28%;
  background: #15110d;
}

.chaos-surrender-portrait-fallback {
  display: grid;
  place-items: center;
  color: #d0ad68;
  font-size: 48px;
  font-weight: 900;
}

.chaos-surrender-identity small,
.chaos-surrender-identity b {
  display: block;
}

.chaos-surrender-identity small {
  color: #aa9671;
  font-size: 10px;
}

.chaos-surrender-identity b {
  margin-top: 2px;
  color: #f1ddac;
  font-size: 23px;
  line-height: 1.2;
}

.chaos-surrender-speech {
  position: relative;
  width: min(390px, 100%);
  margin: 3px 0 0;
  padding: 13px 16px;
  border: 1px solid rgba(216, 187, 126, .48);
  border-radius: 10px;
  background: rgba(8, 7, 6, .72);
  color: #f3e7ca;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
  word-break: keep-all;
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

.chaos-surrender-speech::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(216, 187, 126, .48);
  border-left: 1px solid rgba(216, 187, 126, .48);
  background: #14110d;
  transform: translateX(-50%) rotate(45deg);
}

.chaos-surrender-summary {
  color: #aa9b80;
  font-size: 10px;
}

.chaos-unification-result .result-title.win {
  color: #ffe3a0;
  font-size: clamp(32px, 7vw, 44px);
  letter-spacing: .08em;
  text-shadow: 0 3px 18px rgba(224, 174, 75, .32);
}

.chaos-unification-result > p {
  color: #ddd1b9;
  line-height: 1.6;
  word-break: keep-all;
}

@keyframes chaosSurrenderEnter {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reduce-motion .chaos-final-surrender {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .chaos-final-surrender { animation: none !important; }
}

@media (max-width: 520px) {
  .chaos-unification-result {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px 12px 16px;
  }

  .chaos-final-surrender {
    margin-bottom: 13px;
    padding: 15px 12px 17px;
  }

  .chaos-surrender-portrait-shell {
    width: 104px;
    height: 124px;
  }

  .chaos-surrender-portrait-shell::after {
    right: -8px;
    bottom: -8px;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .chaos-surrender-identity b { font-size: 20px; }
  .chaos-surrender-speech { padding: 11px 12px; font-size: 14px; }
  .chaos-unification-result .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
