/* After-action report: full-size table and fixed actions; scroll instead of tiny type. */
#results .result-dialog {
  width: min(1160px, 100%);
  max-width: 1160px;
  height: min(850px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 9px;
}
#results .results-heading {
  padding: 22px 28px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid #a2bbaa44;
  background: #15333e;
}
#results .results-heading .eyebrow {
  font-size: 13px;
  letter-spacing: 1.5px;
}
#results .results-heading h2 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin: 9px 0;
}
#results #resultReason {
  font-size: 16px;
  line-height: 1.5;
  color: #c4d5c8;
  margin: 0;
}
#results .results-content {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 24px 28px;
  align-items: start;
  scrollbar-color: #71968b #18343e;
}
#results .final-score {
  font-size: 40px;
  line-height: 1.3;
  color: #f0d895;
  margin: 0 0 16px;
}
#results .final-score small {
  display: block;
  font-size: 15px;
  letter-spacing: 0.5px;
  margin-top: 5px;
}
#results .personal-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: none;
  margin: 0;
  padding: 0;
}
#results .personal-stats > div {
  padding: 14px 12px;
  background: #102d37;
  border: 1px solid #a7bfa333;
  border-radius: 6px;
}
#results .personal-stats b {
  font-size: 29px;
  line-height: 1.2;
  font-weight: 650;
}
#results .personal-stats small {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: #c2d3c6;
  margin-top: 7px;
  letter-spacing: 0.3px;
}
#results .sector-timeline {
  grid-template-columns: 1fr;
  gap: 7px;
  margin: 18px 0;
}
#results .sector-timeline > div {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  font-size: 12px;
}
#results .sector-timeline span {
  font-size: 14px;
  flex-shrink: 0;
}
#results .results-scoring {
  margin-top: 18px;
}
#results .results-scoring summary {
  font-size: 15px;
  padding: 12px 0;
  cursor: pointer;
  color: #e0d4a9;
}
#results #scoreKey {
  font-size: 14px;
  line-height: 1.6;
  color: #b5cbbd;
  margin: 6px 0 !important;
}
#results .results-roster {
  min-width: 0;
}
#results .results-roster h3 {
  font-size: 22px;
  font-weight: 650;
  margin: 0 0 14px;
  color: #f1e6c1;
}
#results .score-table {
  display: block;
  overflow-x: auto;
  font-size: 16px;
}
#results .roster-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#results .roster-table caption {
  text-align: left;
  font-size: 14px;
  color: #b4cbbd;
  padding: 0 0 14px;
}
#results .roster-table th,
#results .roster-table td {
  padding: 13px 11px;
  border-bottom: 1px solid #9db8a62b;
  font-size: 18px;
  line-height: 1.25;
}
#results .roster-table thead th {
  font-size: 13px;
  letter-spacing: 0.4px;
  color: #bad0c1;
  background: #12303b;
  font-weight: 600;
}
#results .roster-table tbody th {
  font-weight: 650;
  color: #e8ecdb;
}
#results .roster-table td {
  color: #d2dfd0;
}
#results .roster-table tr.you {
  background: #edd58a16;
  box-shadow: inset 3px 0 #e7d294;
}
#results .roster-table tr.you th {
  color: #ffe5a7;
}
#results .roster-side {
  font-size: 14px;
  letter-spacing: 0.4px;
  font-weight: 600;
}
#results .you-tag {
  font-size: 10px;
  padding: 3px 5px;
  border: 1px solid #eed79560;
  border-radius: 3px;
  margin-left: 5px;
}
#results .result-actions {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 16px;
  margin: 0;
  padding: 18px 28px;
  border-top: 1px solid #9db8a644;
  background: #12303b;
}
#results .result-actions .primary {
  margin: 0;
  min-height: 54px;
  font-size: 17px;
  min-width: 230px;
}
#results .result-actions .secondary {
  min-height: 54px;
  padding: 14px 22px;
  font-size: 15px;
  letter-spacing: 0.4px;
}
@media (max-width: 1000px) {
  #results .results-content {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    padding: 22px;
  }
  #results .roster-table th,
  #results .roster-table td {
    padding: 13px 9px;
  }
  #results .roster-table thead th {
    letter-spacing: 0;
  }
}
@media (max-width: 850px) {
  #results .results-content {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  #results .personal-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #results .sector-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #results .sector-timeline > div {
    flex-direction: column;
    align-items: flex-start;
  }
  #results .final-score small {
    display: inline;
    margin-left: 8px;
  }
  #results .results-heading h2 {
    font-size: 28px;
  }
}
@media (max-width: 550px) {
  #results {
    padding: 12px;
  }
  #results .result-dialog {
    max-height: calc(100dvh - 24px);
    height: calc(100dvh - 24px);
  }
  #results .results-heading {
    padding: 18px;
  }
  #results .results-content {
    padding: 18px;
  }
  #results .personal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #results .result-actions {
    padding: 12px 18px;
    gap: 10px;
  }
  #results .results-heading h2 {
    font-size: 25px;
  }
  #results .final-score {
    font-size: 34px;
  }
  #results .final-score small {
    display: block;
    margin-left: 0;
  }
  #results .roster-table {
    min-width: 520px;
  }
}

/* Progress belongs in reports/Field record, never over combat. */
.level-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #f2edda;
}
.level-heading strong {
  font-size: 20px;
  white-space: nowrap;
}
.level-heading span {
  font-size: 14px;
  color: #b7c9be;
}
.level-track {
  height: 6px;
  border-radius: 3px;
  background: #b7c9be30;
  overflow: hidden;
  margin: 8px 0;
}
.level-track i {
  height: 100%;
  display: block;
  background: #f0d895;
}
#results #runReward {
  padding: 16px;
  background: #102932;
  border: 1px solid #b9cec040;
  border-radius: 6px;
}
#runReward .reward-heading,
#runReward .level-heading {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
#runReward .reward-heading {
  margin-bottom: 12px;
}
#runReward .reward-heading > b {
  color: #f0d895;
  font-size: 28px;
}
#runReward .reward-heading > span {
  font-size: 12px;
  color: #f0d895;
}
#runReward .level-heading strong {
  font-size: 18px;
}
#runReward .level-heading span {
  font-size: 12px;
}
#runReward .level-track {
  display: block;
}
#results #runReward .reward-note {
  font-size: 14px !important;
  line-height: 1.3;
  margin: 8px 0;
  color: #e0e8d7;
}
#runReward .progress-storage {
  display: block;
  font-size: 12px;
  color: #b7c9be;
}
#xpBreakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#xpBreakdown .xp-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#xpBreakdown .xp-source {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  padding: 14px;
  background: #102932;
  border: 1px solid #b9cec040;
  border-radius: 5px;
}
#xpBreakdown .xp-source strong {
  font-size: 16px;
}
#xpBreakdown .xp-source b {
  font-size: 18px;
  color: #f0d895;
}
#xpBreakdown .xp-source span {
  grid-column: 1/-1;
  font-size: 14px;
  line-height: 1.3;
  color: #b7c9be;
}
#xpBreakdown .xp-status {
  font-size: 14px;
  line-height: 1.3;
  margin: 0;
  color: #b7c9be;
}
#xpBreakdown .xp-status b {
  color: #f0d895;
}
@media (max-height: 540px) and (orientation: landscape) {
  #results #runReward {
    padding: 8px;
  }
  #runReward .reward-heading {
    margin-bottom: 4px;
  }
  #runReward .reward-heading > b {
    font-size: 22px;
  }
  #runReward .level-heading {
    flex-wrap: wrap;
    gap: 2px 6px;
  }
  #runReward .level-heading strong {
    font-size: 16px;
  }
  #runReward .level-track {
    height: 4px;
    margin: 4px 0;
  }
  #results #runReward .reward-note {
    font-size: 12px !important;
    margin: 4px 0;
    line-height: 1.2;
  }
  #xpBreakdown {
    gap: 4px;
  }
  #xpBreakdown .xp-sources {
    gap: 4px;
  }
  #xpBreakdown .xp-source {
    padding: 4px 6px;
    gap: 1px 6px;
  }
  #xpBreakdown .xp-source strong,
  #xpBreakdown .xp-source b {
    font-size: 14px;
  }
  #xpBreakdown .xp-source span,
  #xpBreakdown .xp-status {
    font-size: 12px;
    line-height: 1.2;
  }
}
@media (max-height: 380px) and (orientation: landscape) {
  #xpBreakdown .xp-source {
    padding: 2px 6px;
  }
  #xpBreakdown .xp-sources {
    gap: 3px;
  }
}
#arsenal #openRifleSetup {
  margin-left: auto;
  min-height: 44px;
  white-space: nowrap;
}
#arsenal[data-setup='true'] #inventory,
#arsenal[data-setup='true'] #arsenalPager,
#arsenal[data-setup='true'] .arsenal-footer {
  display: none;
}
#arsenal #rifleSetup {
  min-height: 0;
}
#arsenal #rifleSetupStatus {
  font-size: 16px;
  margin: 0 0 16px;
  color: #b7c9be;
}
#arsenal #rifleConfigurationChoices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#arsenal .rifle-configuration {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 18px;
  background: #102932;
  color: #f2edda;
  border: 1px solid #b9cec060;
  border-radius: 5px;
  text-align: left;
}
#arsenal .rifle-configuration[aria-pressed='true'] {
  border: 2px solid #f0d895;
  padding: 17px;
}
#arsenal .rifle-configuration:disabled {
  opacity: 1;
  border-style: dashed;
}
#arsenal .rifle-configuration b {
  font-size: 20px;
}
#arsenal .rifle-configuration .weapon-art {
  width: 100%;
  height: 100px;
  fill: #f0d895;
  margin: 12px 0;
}
#arsenal .rifle-configuration span {
  font-size: 14px;
  color: #b7c9be;
  min-height: 36px;
}
#arsenal .rifle-configuration dl {
  display: grid;
  gap: 8px;
  font-size: 16px;
  margin: 12px 0;
}
#arsenal .rifle-configuration dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
#arsenal .rifle-configuration dd {
  margin: 0;
  font-weight: bold;
}
#arsenal .rifle-configuration strong {
  font-size: 16px;
  color: #f0d895;
}
@media (max-height: 540px) and (orientation: landscape) {
  #arsenal #openRifleSetup {
    font-size: 12px;
    padding: 6px 8px;
  }
  #arsenal #rifleSetupStatus {
    font-size: 12px;
    margin: 0 0 6px;
  }
  #arsenal #rifleConfigurationChoices {
    gap: 6px;
  }
  #arsenal .rifle-configuration,
  #arsenal .rifle-configuration[aria-pressed='true'] {
    padding: 8px;
  }
  #arsenal .rifle-configuration b {
    font-size: 14px;
  }
  #arsenal .rifle-configuration .weapon-art {
    height: 32px;
    margin: 4px 0;
  }
  #arsenal .rifle-configuration span {
    font-size: 12px;
    min-height: 29px;
  }
  #arsenal .rifle-configuration dl {
    gap: 2px;
    margin: 6px 0;
    font-size: 12px;
  }
  #arsenal .rifle-configuration strong {
    font-size: 12px;
  }
}
#arsenal .arsenal-heading #closeArsenal {
  min-height: 44px;
}
#arsenal .arsenal-dialog #arsenalPager button {
  min-height: 44px;
}

#results .result-dialog [role='tab'],
#results .result-dialog #again {
  min-height: 44px;
  min-width: 44px;
}
#matchEnding {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px max(16px, env(safe-area-inset-left));
  background: #061b2470;
}
.match-ending-banner {
  width: min(620px, 100%);
  box-sizing: border-box;
  padding: clamp(20px, 4vh, 40px) 24px;
  text-align: center;
  color: #f0d895;
  background: #102932f2;
  border-block: 2px solid currentColor;
}
#matchEnding[data-outcome='defeat'] .match-ending-banner {
  color: #efb6a0;
}
#matchEnding[data-outcome='draw'] .match-ending-banner {
  color: #c4d7d0;
}
.match-ending-banner .eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: #b7c9be;
}
.match-ending-banner h2 {
  margin: 8px 0;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1;
  letter-spacing: 3px;
}
.match-ending-banner p {
  margin: 0 0 20px;
  font-size: clamp(14px, 2.5vw, 18px);
  color: #f2edda;
}
#showMatchResults {
  min-width: 160px;
  min-height: 44px;
  font-size: 16px;
}
#matchEnding[data-motion='on'] .match-ending-banner {
  animation: match-arrival 240ms ease-out both;
}
#results[data-motion='on'] .result-dialog {
  animation: report-arrival 240ms ease-out both;
}
@keyframes report-arrival {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes match-arrival {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #matchEnding .match-ending-banner,
  #results .result-dialog {
    animation: none;
  }
}
