#result.result {
  --result-edge: #819cb2;
  --result-accent: #ffc349;
  position: fixed;
  inset: 0;
  transform: none;
  width: 100%;
  max-height: none;
  z-index: 30;
  overflow: auto;
  border: 0;
  border-radius: 0;
  padding: 24px;
  background: linear-gradient(90deg, #07112077, #081421bd 58%, #071321e8);
  color: #f1f7fb;
  box-shadow: none;
}
#result[hidden] {
  display: none;
}
#result .result-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  max-width: 1280px;
  height: calc(100dvh - 48px);
  min-height: 0;
  margin: auto;
  padding: 28px;
  border: 2px solid #536a7c;
  background: linear-gradient(130deg, #0b192c55, #0a1723b8 65%);
  box-shadow:
    inset 0 0 0 5px #101b28,
    0 20px 65px #0008;
}
.result-shell::before,
.result-shell::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 4px;
  background: #43d9ea;
  box-shadow: 0 0 12px #43d9ea88;
  pointer-events: none;
}
.result-shell::before {
  left: 24px;
  top: -2px;
}
.result-shell::after {
  right: 24px;
  bottom: -2px;
}
.result-heading {
  grid-column: 1/-1;
  text-align: center;
  position: relative;
}
#result .result-brand {
  color: #dbe5ee;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 0 0 8px;
}
#result #result-title {
  position: relative;
  display: inline-block;
  min-width: 58%;
  margin: 0;
  padding: 10px 70px 20px;
  font-size: clamp(52px, 7vw, 108px);
  line-height: 1.05;
  font-weight: 1000;
  letter-spacing: -4px;
  color: #ffe493;
  -webkit-text-stroke: 1px #ffeebc;
  text-shadow:
    0 3px #bc7c16,
    0 7px #78470a,
    0 11px 15px #000b;
  background: radial-gradient(ellipse at center, #a96e233f, transparent 70%);
}
#result #result-title::before,
#result #result-title::after {
  content: "";
  position: absolute;
  top: 38%;
  width: 15%;
  height: 22px;
  border-top: 5px solid var(--result-accent);
  border-bottom: 2px solid #ac751a;
  transform: skewY(18deg);
  left: 0;
}
#result #result-title::after {
  left: auto;
  right: 0;
  transform: skewY(-18deg);
}
#result #result-reason {
  margin: 0;
  color: #b4c5d4;
  font-size: 14px;
  letter-spacing: 3px;
}
.result-hero {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  overflow-y: auto;
  scrollbar-color: #6b8da7 #102234;
}
#result-portrait {
  width: 100%;
  height: 0;
  flex: 1 0 100px;
  min-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px #0009);
}
#result-unit {
  font-size: 22px;
  color: #ecf3f8;
  text-shadow: 0 2px 3px #000;
  margin: 0 0 10px;
  flex-shrink: 0;
}
#result-rewards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-bottom: 6px;
  scrollbar-color: #6b8da7 #102234;
}
#result .result-reward {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  flex: none;
  border: 2px solid #74899c;
  background: linear-gradient(160deg, #243b51, #0c1c2c 65%);
  box-shadow:
    inset 0 0 0 3px #0a1522,
    inset 0 5px 0 #b7c8d51a,
    0 5px 0 #050c14;
  clip-path: polygon(
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0 calc(100% - 14px),
    0 14px
  );
}
.reward-avatar {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
  background: #102234;
  border: 1px solid #668aa5;
  border-radius: 8px;
}
#result .result-reward.no-gain {
  padding: 8px 12px;
  gap: 10px;
  opacity: .84;
}
#result .no-gain .reward-avatar { width: 36px; height: 36px; }
#result .no-gain .reward-heading { margin-bottom: 4px; }
#result .no-gain .reward-name { font-size: 14px; }
#result .no-gain .reward-gain { font-size: 16px; color: #bac8d2; }
#result .no-gain .reward-level { font-size: 14px; }
#result .no-gain .reward-progress { height: 10px; }
.account-avatar {
  display: grid;
  place-items: center;
  color: #77dafa;
  font-size: 38px;
}
.account-avatar {
  position: relative;
}
.account-avatar::before {
  content: "";
  position: absolute;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #7cddff;
  box-shadow: inset 0 -4px #359acb;
}
.account-avatar::after {
  content: "";
  position: absolute;
  bottom: 9px;
  width: 32px;
  height: 23px;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(#8de6ff, #2588bd);
}
.reward-info {
  min-width: 0;
  flex: 1;
}
.reward-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
#result .reward-name {
  margin: 0;
  color: #eef5fb;
  font-size: 18px;
  font-weight: 850;
}
.reward-gain {
  color: #ffdb73;
  white-space: nowrap;
  font-size: 20px;
  text-shadow: 0 2px #382b0b;
}
.reward-growth {
  display: flex;
  align-items: center;
  gap: 16px;
}
.reward-level {
  min-width: 45px;
  color: #c5eaff;
  font-size: 18px;
}
.reward-progress {
  appearance: none;
  width: 100%;
  height: 18px;
  flex: 1;
  border: 2px solid #47647e;
  background: #050e19;
  border-radius: 6px;
  overflow: hidden;
}
.reward-progress::-webkit-progress-bar {
  background: #050e19;
}
.reward-progress::-webkit-progress-value {
  background: linear-gradient(#ffe595, #ffbd2f 50%, #e78b0d);
  border-right: 2px solid #fff0ae;
  box-shadow: inset 0 2px #fff6;
}
.reward-level-up {
  --result-edge: #ffce55;
  border-color: #ffce55 !important;
}
#result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  background: #0b1a29e8;
  border: 1px solid #728b9e;
  padding: 13px 4px;
  flex-shrink: 0;
}
.result-stat {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 4px;
  border-right: 1px solid #456078;
}
.result-stat:last-child {
  border-right: 0;
}
.stat-icon {
  color: #b7cbdc;
  font-size: 20px;
  line-height: 1;
}
.stat-label {
  color: #b7c7d5;
  font-size: 12px;
}
.stat-value {
  color: #fff;
  font-size: 20px;
}
.result-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  gap: 18px;
  padding-top: 12px;
}
#result .result-action {
  position: relative;
  min-height: 64px;
  padding: 12px 28px;
  min-width: 180px;
  margin: 0;
  border: 2px solid #92a7b9;
  border-radius: 0;
  background: linear-gradient(#344c63, #152638);
  box-shadow:
    inset 0 0 0 3px #0b1928,
    inset 0 5px #ffffff20,
    0 5px #07101b;
  color: #f4f8fc;
  font-size: 23px;
  font-weight: 900;
  clip-path: polygon(
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0 calc(100% - 14px),
    0 14px
  );
}
#result .result-action.primary {
  min-width: 300px;
  color: #241b08;
  border-color: #fff0af;
  background: linear-gradient(#ffdf76, #ffb61e 55%, #e3940e);
  box-shadow:
    inset 0 0 0 3px #9d5d0e,
    inset 0 6px #fff5,
    0 5px #6f4208;
}
#result .result-action:hover {
  filter: brightness(1.13);
}
#result .result-action:active {
  transform: translateY(3px);
  filter: brightness(0.93);
}
#result .result-action:focus-visible {
  outline: 3px solid #6ce9ff;
  outline-offset: -6px;
}
#result-status {
  grid-column: 1/-1;
  text-align: center;
  padding: 14px;
  color: #d6e5f0;
}
#result[data-outcome="loss"] {
  --result-accent: #d47a70;
}
#result[data-outcome="loss"] #result-title {
  color: #e3c4bd;
  -webkit-text-stroke-color: #fff0ea;
  text-shadow:
    0 3px #7d4f4d,
    0 7px #482e31,
    0 11px 15px #000b;
}
#result[data-outcome="draw"] {
  --result-accent: #9ebbcf;
}
#result[data-outcome="hunt"] #result-title {
  font-size: clamp(44px, 6vw, 86px);
}
@media (max-width: 740px) {
  #result.result {
    padding: max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }
  #result .result-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    height: auto;
    min-height: calc(100dvh - 24px);
    padding: 16px 12px;
  }
  #result #result-title {
    min-width: 100%;
    font-size: 64px;
    padding: 8px 40px 16px;
  }
  .result-hero {
    min-height: 0;
    align-items: center;
  }
  #result-portrait {
    width: 240px;
    height: 145px;
    flex: none;
  }
  #result-rewards {
    overflow: visible;
  }
  #result-unit {
    display: none;
  }
  #result .result-reward {
    padding: 13px 12px;
    gap: 10px;
  }
  .reward-avatar {
    width: 48px;
    height: 48px;
  }
  #result .reward-name {
    font-size: 15px;
  }
  .reward-gain {
    font-size: 16px;
  }
  .reward-heading {
    gap: 4px;
    margin-bottom: 10px;
  }
  .reward-level {
    font-size: 15px;
  }
  .reward-progress {
    height: 15px;
  }
  .result-actions {
    position: sticky;
    bottom: -16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
    gap: 7px;
    padding: 10px 0;
    background: linear-gradient(transparent, #0b1726 20%);
  }
  #result .result-action,
  #result .result-action.primary {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }
  #result .result-action.primary { grid-column:1/-1; min-height:48px; font-size:19px; }
  .stat-value {
    font-size: 17px;
  }
}
@media (max-height: 680px) and (min-width: 741px) {
  #result.result { padding: 12px; }
  #result .result-shell { padding: 18px; gap: 12px; height: calc(100dvh - 24px); }
  #result .result-brand { font-size: 11px; margin-bottom: 3px; }
  #result #result-title,
  #result[data-outcome="hunt"] #result-title {
    padding: 6px 50px 12px;
    font-size: 44px;
    letter-spacing: -2px;
  }
  #result #result-reason { font-size: 12px; letter-spacing: .5px; }
  #result-unit { font-size: 18px; margin-bottom: 6px; }
  #result .result-action,
  #result .result-action.primary {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 8px 15px;
    font-size: 18px;
  }
  #result .result-actions { gap: 10px; padding-top: 6px; }
}
@media (max-height: 520px) and (min-width: 741px) {
  #result.result {
    padding: 12px;
  }
  #result .result-shell {
    padding: 16px;
    gap: 14px;
  }
  #result #result-title {
    font-size: 60px;
  }
  #result .result-shell {
    height: auto;
    min-height: calc(100dvh - 24px);
  }
  #result-portrait {
    height: 130px;
    flex: none;
  }
  .result-hero {
    min-height: 200px;
  }
  #result-rewards {
    overflow: visible;
  }
  .result-actions {
    position: sticky;
    bottom: -16px;
    background: #0b1726ee;
    padding: 8px;
  }
}
