.account-identity {
  display: grid;
  gap: 5px;
  text-align: left;
  min-width: 0;
}
.case-action { width: min(540px, calc(100% - 32px)); }
.overload-controls {
  /* The decorative case caption ignores pointer input. Its controls must not. */
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  padding: 12px 8px;
  margin-bottom: 20px;
  border-top: 1px solid #332129;
  border-bottom: 1px solid #21171b;
  background: #060405e6;
  font: 9px/1.5 var(--font-mono);
  letter-spacing: .04em;
  color: #aaa0a4;
}
.reactor-meter { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; border-left: 2px solid #b81833; padding: 4px 10px; }
.reactor-meter b { color: #eee3e7; font: 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.batch-option { display: inline-flex; gap: 9px; align-items: center; min-height: 36px; cursor: pointer; white-space: nowrap; }
.batch-option select { min-width: 60px; min-height: 36px; padding: 6px 10px; border: 1px solid #55323f; background: #100a0d; color: #f0e6eb; font: 12px var(--font-mono); border-radius: 0; cursor: pointer; color-scheme: dark; }
.batch-option select:disabled { opacity: .45; cursor: default; }
.batch-option input { width: 15px; height: 15px; margin: 0; accent-color: #d11634; cursor: pointer; }
.overload-controls :focus-visible { outline: 1px solid #ed3254; outline-offset: 4px; }
#batch-stop, #batch-status { grid-column: 1 / -1; }
#batch-status { margin: 0; font-size: 9px; color: #a99a9f; }
#batch-status:empty { display: none; }
.overload-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 9px; margin: 18px 0; max-height: 46svh; overflow-y: auto; padding: 5px; }
.overload-results .item-card { min-width: 0; width: 100%; padding: 10px; }
.overload-results .hat-art { height: 65px; }
.overload-results .hat-art img { height: 65px; }
.overload-results .item-name { font-size: 10px; }
.overload-results .item-meta { font-size: 8px; }
.overload-origin { display: block; color: #b6a0a7; font: 8px/1.7 var(--font-mono); margin-bottom: 4px; }
.overload-events { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.overload-event { padding: 4px 7px; border-left: 1px solid #923249; background: #210c1455; color: #dca8b6; font: 9px/1.5 var(--font-mono); animation: overload-event-in 260ms ease-out both; }
.event-reactor { color: #d4bc90; border-color: #8e7447; }
.event-relay { color: #b4cde2; border-color: #516f8b; }
.event-anomaly { color: #d5b7e8; border-color: #816494; }
.event-overload { color: #fff; border-color: #ed2144; }
.result-item-actions { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 8px; }
.result-item-actions button { font-size: 8px; color: #aa9099; }
.result-item-actions form { display: flex; flex-wrap: wrap; gap: 5px; }
.result-item-actions input { width: 70px; padding: 5px; color: #e0ced6; background: #0a0708; border: 1px solid #462b35; font: 10px var(--font-mono); }
.overload-result-card.is-kept { border-color: #a49075; }
.overload-result-card.is-handled { opacity: .3; }
@keyframes overload-event-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .overload-results { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overload-controls { grid-template-columns: auto auto; gap: 8px 16px; padding: 9px 8px; margin-bottom: 15px; }
  .batch-speed-option { grid-column: 1 / -1; justify-content: center; min-height: 30px; }
  .case-glow { left: 8%; right: 8%; }
}
@media (prefers-reduced-motion: reduce) { .overload-event { animation: none; } }
/* A travelling spectrum across the letters, rather than one cycling hue. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .leader-nickname.leader-nickname {
    background-image: linear-gradient(90deg, #ff8ca5 0%, #ffc17c 8.33%, #f6ee90 16.67%, #9ae4b2 25%, #8bcdfb 33.33%, #c1a2ff 41.67%, #ff8ca5 50%, #ffc17c 58.33%, #f6ee90 66.67%, #9ae4b2 75%, #8bcdfb 83.33%, #c1a2ff 91.67%, #ff8ca5 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: leader-spectrum 4s linear infinite;
  }
}
@keyframes leader-spectrum {
  from { background-position: 200% 50%; }
  to { background-position: 0% 50%; }
}
.leader-tooltip {
  position: fixed;
  inset: auto;
  margin: 0;
  width: max-content;
  max-width: min(270px, calc(100vw - 24px));
  padding: 13px 16px;
  border: 1px solid #3b3033;
  border-left: 2px solid #bd1630;
  background: #0d0b0cf5;
  color: #d5cdd0;
  box-shadow: 0 8px 28px #0009;
  font: 12px/1.65 var(--font-mono);
  text-align: left;
  z-index: 3000;
}
.leader-tooltip::backdrop { display: none; }
.leader-tooltip[hidden] { display: none; }
.profile-activity-controls, .activity-pages, .comment-pages {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-activity-controls { justify-content: space-between; margin-top: 16px; }
.activity-page, .comments-page { font: 10px var(--font-mono); color: #9d9296; }
.profile-activity .history-list li.profile-opening-row {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid #282124;
}
.profile-activity .history-list li.profile-opening-row strong {
  font: 10px var(--font-mono);
  color: #d6cdd0;
}
.profile-opening-items {
  min-width: 0;
  overflow: hidden;
  color: #b7abb0;
  font: 11px/1.4 var(--font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-activity .history-list li.profile-opening-row time,
.profile-comment-head time {
  font: 10px/1.5 var(--font-mono);
  color: #867e82;
}
.profile-comments { margin-top: 30px; padding-top: 24px; border-top: 1px solid #37272c; }
.profile-comments h3 { margin: 0; font: 18px var(--font-ui); }
.profile-comment-form label { display: grid; gap: 10px; color: #a79da1; font: 10px var(--font-mono); }
.profile-comment-form textarea {
  resize: vertical;
  width: 100%;
  min-height: 88px;
  max-height: 220px;
  padding: 14px;
  border: 1px solid #382b30;
  border-radius: 0;
  background: #0b090a;
  color: #e6dde1;
  font: 13px/1.6 var(--font-ui);
}
.profile-comment-form textarea:focus-visible { outline: 1px solid #d11634; outline-offset: 2px; }
.comment-form-footer { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: 10px; }
.comment-form-footer .button { min-height: 40px; padding: 10px 16px; }
.profile-comment { padding: 16px 0; border-bottom: 1px solid #282124; }
.profile-comment-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.profile-comment-head .player-link { display: inline-flex; align-items: center; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.profile-comment-head .avatar { width: 25px; height: 25px; border-radius: 0; }
.profile-comment p { margin: 10px 0; color: #c8bec3; font: 13px/1.7 var(--font-ui); overflow-wrap: anywhere; white-space: pre-wrap; }
.comment-delete { color: #9b7b85; font-size: 9px; }
.comment-pages { justify-content: flex-end; margin-top: 14px; }
.activity-status:empty { display: none; }
@media (max-width: 500px) {
  .profile-activity .history-list li.profile-opening-row {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }
  .profile-opening-items {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 0;
  }
  .comment-form-footer { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .leader-nickname.leader-nickname { animation: none; background-position: 50% 50%; }
}
.account-standing {
  position: relative;
  display: flex;
  gap: 6px;
  align-items: baseline;
  white-space: nowrap;
  font: 8px/1.2 var(--font-mono);
  letter-spacing: 0.025em;
  color: #817875;
}
.account-standing b {
  font-size: 11px;
  font-weight: 400;
  color: #cbbdaf;
  font-variant-numeric: tabular-nums;
}
.standing-separator {
  color: #463c39;
}
.standing-gain {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
  font: 14px/1.3 var(--font-mono);
  color: #fff;
  text-shadow: 0 0 12px #fff7, 0 2px 8px #000;
  animation: standing-gain-rise 1s cubic-bezier(.2,.65,.3,1) both;
}
.standing-gain.is-unusual {
  color: #eacbff;
  text-shadow: 0 0 12px #c899ff9, 0 2px 8px #000;
}
@keyframes standing-gain-rise {
  0% { opacity: 0; transform: translate(var(--gain-offset), 9px) scale(.85); }
  18% { opacity: 1; transform: translate(var(--gain-offset), 0) scale(1.1); }
  55% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--gain-offset), -35px) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .standing-gain { animation-name: standing-gain-fade; }
  @keyframes standing-gain-fade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
  }
}
.workshop-placement-gain.is-negative {
  color: #c3a5a3;
}
.reward-flight-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  pointer-events: none;
  overflow: visible;
  z-index: 2500;
}
.reward-flight-layer::backdrop {
  display: none;
}
.reward-art-flight {
  position: absolute;
  pointer-events: none;
  margin: 0;
  padding: 10px;
  transform-origin: center;
  box-shadow: 0 12px 25px #0008;
}
.reward-art-flight .hat-art {
  height: 100px;
  margin: 0 0 10px;
}
.reward-art-flight .item-name {
  font-size: 10px;
}
.reward-art-flight .item-meta {
  font-size: 8px;
}
.reward-score-flight {
  position: absolute;
  font: 22px/1.4 var(--font-mono);
  font-weight: 400;
  color: #e0d7cc;
  white-space: nowrap;
  text-shadow: 0 2px 18px #000;
  pointer-events: none;
}
.reward-score-flight.rare {
  color: #95bdea;
}
.reward-score-flight.legendary {
  color: #edd08b;
  font-size: 28px;
  text-shadow: 0 0 22px #ba872847;
}
.reward-score-flight.is-unusual {
  background: linear-gradient(
    90deg,
    #ff8db3,
    #ffca8b,
    #e3eaa2,
    #9cdde9,
    #b4aeff,
    #ff8db3
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 8px #000);
  animation: unusual-score-color 2s linear infinite;
}
.standing-arrival {
  display: inline-block;
  transform-origin: center;
  animation: standing-arrival 420ms cubic-bezier(.2,.7,.3,1);
}
.inventory-arrival {
  transform-origin: center;
  animation: inventory-arrival 420ms cubic-bezier(.2,.7,.3,1);
}
.inventory-arrival #nav-count {
  display: inline-block;
  animation: standing-arrival 420ms cubic-bezier(.2,.7,.3,1);
}
#opening-dialog .is-reward-departing {
  filter: brightness(1.2);
}
#opening-dialog .is-reward-collected {
  opacity: 0.35;
}
.reward-burst {
  position: absolute;
  width: 1px;
  height: 1px;
  --reward-color: #bfb5ac;
  pointer-events: none;
}
.reward-burst.rare {
  --reward-color: #6c9ecd;
}
.reward-burst.legendary {
  --reward-color: #daba6a;
}
.reward-burst.is-unusual {
  --reward-color: #d9a2db;
}
.reward-burst::before {
  content: "";
  position: absolute;
  left: -28px;
  top: -28px;
  width: 56px;
  height: 56px;
  border: 1px solid var(--reward-color);
  border-radius: 50%;
  animation: reward-ring 0.65s ease-out both;
}
.reward-burst i {
  position: absolute;
  width: 18px;
  height: 1px;
  background: var(--reward-color);
  transform-origin: left center;
  animation: reward-spark 0.7s ease-out both;
}
@keyframes reward-spark {
  from {
    opacity: 1;
    transform: rotate(var(--spark-angle)) translateX(15px) scaleX(0.5);
  }
  to {
    opacity: 0;
    transform: rotate(var(--spark-angle)) translateX(85px) scaleX(0.15);
  }
}
@keyframes reward-ring {
  from {
    opacity: 0.8;
    transform: scale(0.4);
  }
  to {
    opacity: 0;
    transform: scale(2.4);
  }
}
@keyframes unusual-score-color {
  to {
    background-position: -200% 0;
  }
}
@keyframes standing-arrival {
  0% { transform: scale(1); }
  24% {
    transform: scale(1.24);
    color: #fff;
    text-shadow: 0 0 8px #fff9, 0 0 22px #fff5;
  }
  58% {
    transform: scale(1.07);
    color: #fff;
    text-shadow: 0 0 12px #fff4;
  }
  100% {
    transform: scale(1);
    text-shadow: none;
  }
}
@keyframes inventory-arrival {
  0%, 100% { transform: scale(1); }
  24% {
    transform: scale(1.09);
    color: #fff;
    text-shadow: 0 0 12px #fff8;
    filter: brightness(1.7);
  }
  58% { transform: scale(1.025); color: #fff; }
}
@media (max-width: 700px) {
  .account-standing {
    font-size: 7px;
    gap: 4px;
  }
  .account-standing b {
    font-size: 9px;
  }
  .account-identity {
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .standing-arrival,
  .inventory-arrival,
  .inventory-arrival #nav-count,
  .reward-score-flight.is-unusual {
    animation: none;
  }
}
@media (max-width: 700px) {
  .navigation .account-link {
    max-width: 180px;
  }
  .account-identity #nickname {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.opening-modal.is-collecting-out::backdrop {
  animation: reward-backdrop-out 320ms ease-out both;
}
#opening-actions:not(.hidden) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
#dismantle-rewards { color: #d8c4aa; border-color: #564535; }
#dismantle-rewards:hover:enabled { color: #fff; border-color: #ac7b45; background: #281b12; }
.dismantle-preview .winning-item { animation: dismantle-tremble 160ms ease-in-out infinite alternate; }
@keyframes dismantle-tremble {
  from { transform: translateX(-3px) rotate(-1.6deg); }
  to { transform: translateX(3px) rotate(1.6deg); }
}
.reward-scrap-flight {
  position: absolute;
  pointer-events: none;
  white-space: nowrap;
  color: #f0d2a4;
  font: 19px/1.4 var(--font-mono);
  text-shadow: 0 0 14px #dca35866, 0 2px 8px #000;
}
.scrap-resource { position: relative; }
.scrap-arrival { animation: inventory-arrival 420ms ease-out; }
.scrap-arrival #wallet-scrap { display: inline-block; animation: standing-arrival 420ms ease-out; }
.wallet-scrap-gain {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  color: #ffe4bd;
  font: 14px/1.4 var(--font-mono);
  pointer-events: none;
  --gain-offset: 0px;
  animation: standing-gain-rise 800ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .dismantle-preview .winning-item, .scrap-arrival, .scrap-arrival #wallet-scrap { animation: none; }
  .wallet-scrap-gain { animation-name: standing-gain-fade; }
}
@keyframes reward-backdrop-out {
  from {
    background: rgba(0, 0, 0, 0.4);
    opacity: 1;
  }
  to {
    background: rgba(0, 0, 0, 0);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .opening-modal.is-collecting-out::backdrop {
    animation-duration: 120ms;
  }
}
