/* Cast chapter seal. A gilt rim records five clears; the green stone records the optional feat. */
.honor-medal {
  --honor-enamel: #456e65;
  position: relative; display: inline-grid; place-items: center; flex: none; isolation: isolate;
  width: 48px; height: 50px; color: #beccc1;
  border: 2px solid #a7ada0; border-radius: 46% 46% 45% 45%;
  background: radial-gradient(ellipse at 41% 22%,#7e9286,#405654 73%);
  box-shadow: 0 2px 1px #142c2a, inset 0 0 0 2px #4a5b50, inset 0 0 0 4px #a1ab93;
}
.honor-medal::before {
  content: ""; position: absolute; inset: 4px;
  border: 1px dashed #b8c1a6b3; border-radius: inherit; pointer-events: none;
}
.honor-medal::after {
  content: attr(data-chapter); position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  font: 700 8px/1 Georgia,serif; letter-spacing: .045em; padding: 1px 3px;
  color: #e3e2bd; background: #38504b; border: 1px solid #889b83; border-radius: 2px;
}
.honor-medal[data-earned="true"] {
  color: #ffe3a4; border-color: #e2c287;
  background: radial-gradient(ellipse at 37% 23%,#d5c88e -25%,var(--honor-enamel) 57%,#263d39 106%);
  box-shadow: 0 2px 1px #382c1a, inset 0 0 0 2px #725027, inset 0 0 0 4px #dab06a;
}
.honor-medal[data-earned="true"]::before { border-color: #f0d084; }
.honor-medal[data-earned="true"]::after { border-color: #ad8b53; background: #735a34; color: #fff0ba; }
.honor-medal .icon, #outcome .honor-medal .icon {
  display: block; width: 54%; height: 54%; padding: 0; margin-bottom: 3px;
  color: inherit; border: 0; border-radius: 0; filter: drop-shadow(0 1px 0 #35483a);
}
.honor-medal i {
  position: absolute; z-index: 2; right: 0; bottom: 4px; width: 8px; height: 8px; transform: rotate(45deg);
  border: 1px solid #93a18c; background: #45554d; box-shadow: 0 1px 1px #243a2d;
}
.honor-medal[data-mastered="true"] i { border-color: #f3e7a7; background: linear-gradient(135deg,#eeffcc,#9bd6a7 49%,#519d83 50%); }
#honor-goal-open {
  justify-content: center; gap: 4px; min-width: 0; padding: 0 8px;
  color: #ece0b7; border-color: #809282; font-size: 12px;
}
#honor-goal-open .icon { width: 16px; height: 16px; color: #d6c18c; }
.atlas-story { padding-top: 29px; }
.atlas-story > .honor-medal { z-index: 1; margin: 0 1px 1px 0; }
#honor-total {
  position: absolute; z-index: 1; top: 6px; right: 7px; color: #f8e6b0;
  background: #1d3631dc; border: 1px solid #a49772; border-radius: 3px;
  padding: 2px 5px; font: 650 11px/1.2 system-ui,sans-serif;
}
#honor-seal-state { display: block; position: relative; margin-top: 4px; font-size: 11px; color: #e5dabc; }
#honor-goal { margin: 0 0 8px; color: #e0dfc5; border: 1px solid #7e9079; border-radius: 5px; background: #284440; }
#honor-goal summary {
  display: flex; align-items: center; min-height: 36px; gap: 6px; padding: 4px 8px;
  font: 600 12px/1.45 system-ui,sans-serif; cursor: pointer; list-style: none;
}
#honor-goal summary::-webkit-details-marker { display: none; }
#honor-goal summary:focus-visible { outline: 2px solid #f4d697; outline-offset: 1px; border-radius: 4px; }
#honor-goal summary > .icon { width: 13px; height: 13px; transform: rotate(90deg); }
#honor-goal[open] summary > .icon { transform: rotate(-90deg); }
.engraving-gem { flex: none; width: 10px; height: 10px; transform: rotate(45deg); border: 1px solid #a3af91; background: #51675c; }
#honor-goal[data-mastered="true"] .engraving-gem { background: linear-gradient(135deg,#e4ffcf,#addab1 49%,#5e9f85 50%); border-color: #eddd9e; }
#honor-mastery-state { color: #c1cebb; margin-left: auto; white-space: nowrap; font-size: 11px; }
#honor-goal[data-mastered="true"] #honor-mastery-state { color: #c2e6b4; }
.honor-goal-copy { padding: 0 9px 8px 24px; }
#honor-goal-description { margin: 0; font-size: 13px; line-height: 1.55; color: #e9edda; }
#honor-mastery-total { display: block; margin-top: 3px; font-size: 11px; color: #c5d3bb; }
#outcome { max-width: calc(100% - 22px); }
#outcome[data-award="true"] > .icon { display: none; }
#outcome .honor-medal { align-self: center; }
#honor-verdict { display: flex; align-items: center; gap: 8px; margin-top: 5px; font: 600 12px/1.35 system-ui,sans-serif; }
#honor-record { color: #c1e4c5; }
#outcome[data-record="best"] #honor-record, #outcome[data-record="first"] #honor-record { color: #ffcf7e; }
#honor-chapter-progress { padding-left: 8px; border-left: 1px solid #a79b72; color: #d8d9c3; font-size: 11px; white-space: nowrap; }
#honor-award { margin: 3px 0 0; color: #f4d89c; font: 700 12px/1.45 system-ui,sans-serif; }
@media (prefers-reduced-motion:no-preference) {
  #outcome[data-award="true"] #honor-win-seal { animation: tide-impression .53s cubic-bezier(.2,.75,.34,1) both; }
  @keyframes tide-impression {
    0% { opacity: .25; transform: translateY(-5px) scale(1.17) rotate(-6deg); }
    56% { opacity: 1; transform: translateY(1px) scale(.96) rotate(1deg); }
    to { opacity: 1; transform: none; }
  }
}
@media (max-width:680px) {
  #honor-goal-open { min-height: 33px; padding: 0 6px; }
  .atlas-story { min-height: 102px; padding-top: 25px; }
  .honor-medal { width: 40px; height: 42px; }
  #honor-total { top: 4px; right: 4px; font-size: 10px; }
  #outcome { gap: 7px; padding: 9px 11px; }
  #honor-verdict { font-size: 11px; gap: 5px; }
  #honor-award { max-width: 18em; white-space: normal; line-height: 1.22; font-size: 11px; }
  #honor-chapter-progress { padding-left: 5px; font-size: 10px; }
}
@media (orientation:landscape) and (max-height:510px) {
  #honor-goal-open { min-height: 26px; padding: 0 5px; }
  #honor-goal-open .icon { display: none; }
  #honor-goal { grid-column: 1/-1; margin: 0; }
  #honor-goal summary { min-height: 29px; }
  .atlas-story { min-height: 85px; padding: 17px 5px 5px; gap: 4px; }
  .honor-medal { width: 31px; height: 34px; }
  #honor-seal-state { font-size: 9px; margin-top: 1px; }
  #honor-total { top: 2px; right: 2px; font-size: 9px; }
  #outcome { top: 34%; padding: 6px 9px; }
  #outcome small, #honor-award, #honor-verdict { font-size: 10px; }
  #honor-verdict { margin-top: 2px; }
}
