:root {
  color-scheme: dark;
  --ink: #12131a;
  --snow: #edf6ff;
  --ice: #8de8ff;
  --teal: #45c6cd;
  --gold: #d3a54a;
  --red: #dc4a32;
  --plum: #715293;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(17, 30, 35, 0.98), rgba(41, 29, 34, 0.98)),
    #12131a;
  color: var(--snow);
  font-family:
    "Yu Gothic UI",
    "Meiryo",
    system-ui,
    sans-serif;
}

button {
  min-height: 34px;
  border: 1px solid rgba(237, 246, 255, 0.22);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.08);
  color: var(--snow);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: rgba(141, 232, 255, 0.65);
  background: rgba(141, 232, 255, 0.16);
}

button:disabled {
  cursor: default;
  opacity: 0.35;
}

button.primary {
  border-color: rgba(69, 198, 205, 0.72);
  background: rgba(69, 198, 205, 0.32);
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 420px;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  background: #151821;
  cursor: url("./cursor-reticle.svg") 24 24, crosshair;
}

#boot-panel,
.overlay-panel {
  position: absolute;
  border: 1px solid rgba(237, 246, 255, 0.2);
  border-radius: 8px;
  background: rgba(18, 19, 26, 0.88);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
}

#boot-panel {
  display: grid;
  place-items: center;
  inset: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #070b13;
  box-shadow: none;
  opacity: 1;
  transform: none;
  transition: opacity 420ms ease, visibility 420ms ease;
  z-index: 30;
}

#boot-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.02), transparent 34%),
    linear-gradient(180deg, rgba(3, 7, 14, 0.08), rgba(3, 7, 14, 0.32));
  pointer-events: none;
}

.boot-splash-bg,
.boot-splash-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.boot-splash-bg {
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: blur(20px);
  opacity: 0.72;
  transform: scale(1.08);
}

.boot-splash-image {
  z-index: 1;
  object-fit: cover;
}

#boot-panel.is-splash-off .boot-splash-bg,
#boot-panel.is-splash-off .boot-splash-image,
#boot-panel.is-splash-fallback .boot-splash-bg,
#boot-panel.is-splash-fallback .boot-splash-image {
  display: none;
}

#boot-status {
  position: absolute;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 2;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(237, 246, 255, 0.2);
  border-radius: 999px;
  background: rgba(5, 8, 15, 0.58);
  color: rgba(237, 246, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.overlay-panel {
  right: 18px;
  bottom: 18px;
  width: min(390px, calc(100vw - 36px));
  padding: 16px;
}

.overlay-panel header {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

.overlay-panel p,
.overlay-panel h1,
.overlay-panel h2 {
  margin: 0;
}

.overlay-panel p {
  color: rgba(141, 232, 255, 0.82);
  font-size: 12px;
  font-weight: 900;
}

.overlay-panel h1,
.overlay-panel h2 {
  color: var(--snow);
  font-size: 22px;
  line-height: 1.2;
}

.overlay-panel header small {
  color: rgba(237, 246, 255, 0.68);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.prerun-hub {
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  width: auto;
  max-height: none;
  overflow: hidden;
  background: rgba(18, 19, 26, 0.94);
}

.prerun-hub-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 0;
}

.prerun-hub-status {
  display: flex;
  gap: 8px;
  align-items: center;
}

.prerun-hub-status span,
.prerun-section-heading span {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid rgba(141, 232, 255, 0.18);
  border-radius: 7px;
  background: rgba(141, 232, 255, 0.08);
  color: rgba(237, 246, 255, 0.78);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.prerun-hub-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(320px, 1.08fr) minmax(340px, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.prerun-character-pane,
.prerun-preview-pane,
.prerun-loadout-pane,
.prerun-growth,
.prerun-mode-panel {
  min-height: 0;
  min-width: 0;
}

.prerun-character-pane,
.prerun-preview-pane,
.prerun-loadout-pane {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: hidden;
}

.prerun-character-pane,
.prerun-preview-pane,
.prerun-loadout,
.prerun-mode-panel,
.prerun-growth {
  padding: 11px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 8px;
  background: rgba(237, 246, 255, 0.055);
}

.prerun-character-pane h2 {
  margin: 0;
  color: rgba(141, 232, 255, 0.84);
  font-size: 13px;
  font-weight: 900;
}

.prerun-section-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.prerun-section-heading strong {
  min-width: 0;
  color: rgba(141, 232, 255, 0.84);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prerun-section-heading button {
  min-width: 92px;
  min-height: 32px;
  padding: 0 9px;
}

.character-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: min(28vh, 226px);
  margin-bottom: 12px;
  overflow: auto;
}

.prerun-hub .character-list {
  grid-template-columns: 1fr;
  max-height: none;
  margin-bottom: 0;
  min-height: 0;
}

.field-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.prerun-hub .field-list {
  margin-bottom: 0;
}

.character-button {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 8px;
  border-color: rgba(237, 246, 255, 0.14);
  text-align: left;
}

.character-button[data-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 24%, rgba(237, 246, 255, 0.08));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.character-button[data-locked="true"] {
  border-color: rgba(237, 246, 255, 0.09);
  background: rgba(237, 246, 255, 0.035);
  opacity: 0.52;
}

.character-button strong,
.character-button span,
.character-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-button strong {
  color: var(--snow);
  font-size: 13px;
}

.character-button span {
  color: rgba(237, 246, 255, 0.76);
  font-size: 11px;
}

.character-button small {
  color: rgba(141, 232, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.field-button {
  min-height: 34px;
  border-color: rgba(237, 246, 255, 0.14);
}

.field-button[data-selected="true"] {
  border-color: rgba(211, 165, 74, 0.75);
  background: rgba(211, 165, 74, 0.2);
}

.sortie-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.sortie-mode-button {
  display: grid;
  gap: 3px;
  min-height: 102px;
  padding: 8px 9px;
  border-color: rgba(237, 246, 255, 0.14);
  text-align: left;
}

.sortie-mode-button[data-selected="true"] {
  border-color: rgba(211, 165, 74, 0.78);
  background: rgba(211, 165, 74, 0.18);
}

.sortie-mode-button strong {
  color: var(--snow);
  font-size: 12px;
  font-weight: 900;
}

.sortie-mode-button span {
  color: rgba(237, 246, 255, 0.68);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.story-episode-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(141, 232, 255, 0.18);
  border-radius: 7px;
  background: rgba(141, 232, 255, 0.07);
}

.story-episode-panel > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.story-episode-panel strong {
  color: var(--snow);
  font-size: 14px;
  font-weight: 950;
}

.story-episode-panel span,
.story-episode-panel small,
.story-episode-rewards {
  color: rgba(237, 246, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.story-episode-panel small[data-cleared="true"] {
  color: #8de8ff;
}

.story-episode-rewards {
  max-width: 190px;
  text-align: right;
}

.story-scene-panel {
  width: min(560px, calc(100vw - 32px));
}

.story-scene-body {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--snow);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.75;
}

.story-scene-body p {
  margin: 0;
}

.story-scene-panel[data-scene="outro"] {
  border-color: rgba(211, 165, 74, 0.42);
}


.prerun-ready-status {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid rgba(141, 232, 255, 0.16);
  border-radius: 7px;
  background: rgba(141, 232, 255, 0.08);
  color: rgba(237, 246, 255, 0.78);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.prerun-hub .prerun-ready-status {
  margin-bottom: 0;
}

.prerun-ready-status[data-phase="ready"],
.prerun-ready-status[data-phase="countdown"] {
  border-color: rgba(211, 165, 74, 0.42);
  background: rgba(211, 165, 74, 0.13);
}

.prerun-loadout,
.prerun-mode-panel,
.prerun-growth {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.prerun-character-preview {
  display: grid;
  grid-template-columns: minmax(128px, 0.78fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 224px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--character-accent, var(--ice)) 42%, rgba(237, 246, 255, 0.14));
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 34%, color-mix(in srgb, var(--character-accent, var(--ice)) 24%, transparent), transparent 38%),
    rgba(237, 246, 255, 0.055);
}

.prerun-character-art {
  width: min(100%, 174px);
  aspect-ratio: 1 / 1.18;
  justify-self: center;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 400% 500%;
  image-rendering: auto;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.42));
}

.prerun-character-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.prerun-character-copy span {
  color: color-mix(in srgb, var(--character-accent, var(--ice)) 72%, var(--snow));
  font-size: 12px;
  font-weight: 900;
}

.prerun-character-copy strong {
  color: var(--snow);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
}

.prerun-character-copy small {
  color: rgba(237, 246, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.prerun-character-traits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.prerun-character-traits span {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 52px;
  padding: 8px;
  border: 1px solid rgba(237, 246, 255, 0.11);
  border-radius: 7px;
  background: rgba(18, 19, 26, 0.36);
  color: var(--snow);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prerun-character-traits strong {
  color: rgba(141, 232, 255, 0.76);
  font-size: 10px;
}

.prerun-equipment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.prerun-equipment-slot {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 76px;
  padding: 8px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 8px;
  background: rgba(18, 19, 26, 0.48);
}

.prerun-equipment-slot[data-equipped="true"] {
  background: rgba(237, 246, 255, 0.07);
}

.prerun-equipment-slot[data-synergy="true"] {
  border-color: rgba(141, 232, 255, 0.52);
  box-shadow: 0 0 16px rgba(141, 232, 255, 0.12), inset 0 0 10px rgba(141, 232, 255, 0.07);
}

.prerun-equipment-icon {
  width: 46px;
  height: 46px;
}

.prerun-equipment-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.prerun-equipment-body strong,
.prerun-equipment-body span,
.prerun-equipment-body small,
.prerun-equipment-summary,
.prerun-synergy-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prerun-equipment-body strong {
  color: rgba(141, 232, 255, 0.8);
  font-size: 10px;
  font-weight: 900;
}

.prerun-equipment-body span {
  color: var(--snow);
  font-size: 12px;
  font-weight: 900;
}

.prerun-equipment-body small,
.prerun-equipment-summary,
.prerun-synergy-summary {
  color: rgba(237, 246, 255, 0.64);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.prerun-synergy-summary[data-active="true"] {
  color: var(--ice);
}

.sortie-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sortie-mode-button {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 118px;
  padding: 9px;
  text-align: left;
}

.sortie-mode-button[data-selected="true"] {
  border-color: rgba(211, 165, 74, 0.72);
  background: rgba(211, 165, 74, 0.16);
}

.sortie-mode-button[data-enabled="false"] {
  opacity: 0.48;
}

.sortie-mode-button strong,
.sortie-mode-button span,
.sortie-mode-button small {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sortie-mode-button strong {
  color: var(--snow);
  font-size: 13px;
}

.sortie-mode-button span {
  color: rgba(141, 232, 255, 0.74);
  font-size: 11px;
  font-weight: 900;
}

.sortie-mode-button small {
  color: rgba(237, 246, 255, 0.64);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.prerun-actions {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-self: end;
  margin-top: 0;
}

.prerun-actions button {
  min-height: 42px;
}

.queue-list {
  display: grid;
  gap: 8px;
  max-height: min(38vh, 300px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.queue-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 9px 8px;
  border: 1px solid rgba(237, 246, 255, 0.14);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.06);
}

.queue-label {
  min-width: 0;
  color: var(--snow);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-row small {
  grid-column: 1;
  color: rgba(237, 246, 255, 0.55);
  font-size: 11px;
  font-weight: 800;
}

.queue-controls {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  gap: 5px;
}

.queue-controls button {
  width: 34px;
  min-height: 30px;
  padding: 0;
}

.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.town-actions {
  grid-template-columns: 1fr;
}

.town-panel {
  left: 18px;
  right: auto;
  top: 18px;
  bottom: auto;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.town-rewards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.town-next-action {
  padding: 9px 10px;
  border: 1px solid rgba(211, 165, 74, 0.34);
  border-radius: 7px;
  background: rgba(211, 165, 74, 0.12);
  color: #ffe8a3;
  font-size: 12px;
  font-weight: 900;
}

.town-rewards div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.06);
}

.town-rewards dt {
  color: rgba(141, 232, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
}

.town-rewards dd {
  margin: 0;
  color: var(--snow);
  font-size: 14px;
  font-weight: 900;
}

.town-equipment {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.045);
}

.town-equipment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.town-equipment-title {
  color: var(--snow);
  font-size: 12px;
  font-weight: 900;
}

.town-equipment-synergy {
  min-width: 0;
  overflow: hidden;
  color: rgba(141, 232, 255, 0.74);
  font-size: 10px;
  font-weight: 900;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.town-equipment-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.town-equipment-slot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 7px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(18, 19, 26, 0.58);
}

.town-equipment-slot[data-equipped="true"] {
  background: rgba(237, 246, 255, 0.07);
}

.town-equipment-slot[data-synergy="true"] {
  border-color: rgba(141, 232, 255, 0.54);
  box-shadow: 0 0 16px rgba(141, 232, 255, 0.14), inset 0 0 10px rgba(141, 232, 255, 0.08);
}

.town-equipment-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(237, 246, 255, 0.28);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.07);
  color: var(--snow);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.town-equipment-icon[data-rarity="rare"] {
  border-color: rgba(141, 232, 255, 0.76);
  box-shadow: 0 0 10px rgba(141, 232, 255, 0.22);
  color: #8de8ff;
}

.town-equipment-icon[data-rarity="epic"] {
  border-color: rgba(198, 144, 255, 0.78);
  box-shadow: 0 0 12px rgba(198, 144, 255, 0.22);
  color: #c690ff;
}

.town-equipment-icon[data-rarity="legendary"] {
  border-color: rgba(211, 165, 74, 0.9);
  box-shadow: 0 0 14px rgba(211, 165, 74, 0.26), inset 0 0 0 1px rgba(255, 239, 170, 0.26);
  color: var(--gold);
}

.town-equipment-main {
  min-width: 0;
}

.town-equipment-main strong,
.town-equipment-main span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.town-equipment-main strong {
  color: rgba(141, 232, 255, 0.82);
  font-size: 10px;
  font-weight: 900;
}

.town-equipment-main span {
  margin-top: 2px;
  color: var(--snow);
  font-size: 11px;
  font-weight: 900;
}

.town-equipment-slot[data-equipped="false"] .town-equipment-main span {
  color: rgba(237, 246, 255, 0.46);
}

.town-equipment-link {
  position: absolute;
  z-index: 1;
  display: block;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(141, 232, 255, 0.8), rgba(198, 144, 255, 0.74), transparent);
  box-shadow: 0 0 9px rgba(141, 232, 255, 0.64);
  opacity: 0.82;
  pointer-events: none;
  transform-origin: left center;
  animation: town-electric-pulse 1.2s ease-in-out infinite;
}

.town-equipment-link[data-legendary="true"] {
  background: linear-gradient(90deg, rgba(141, 232, 255, 0), rgba(141, 232, 255, 0.82), rgba(211, 165, 74, 0.88), rgba(255, 118, 204, 0.76), rgba(141, 232, 255, 0));
  box-shadow: 0 0 12px rgba(211, 165, 74, 0.4), 0 0 18px rgba(141, 232, 255, 0.32);
}

.town-equipment-link-kunai-ring,
.town-equipment-link-trap-charm {
  left: 26%;
  width: 48%;
}

.town-equipment-link-kunai-ring {
  top: 25%;
}

.town-equipment-link-trap-charm {
  top: 75%;
}

.town-equipment-link-kunai-trap,
.town-equipment-link-ring-charm {
  top: 27%;
  width: 48%;
  transform: rotate(90deg);
}

.town-equipment-link-kunai-trap {
  left: 25%;
}

.town-equipment-link-ring-charm {
  left: 75%;
}

.town-equipment-link-kunai-charm,
.town-equipment-link-ring-trap {
  top: 27%;
  width: 66%;
}

.town-equipment-link-kunai-charm {
  left: 27%;
  transform: rotate(33deg);
}

.town-equipment-link-ring-trap {
  left: 73%;
  transform: rotate(147deg);
}

@keyframes town-electric-pulse {
  0%,
  100% {
    opacity: 0.5;
    filter: saturate(1);
  }
  50% {
    opacity: 0.95;
    filter: saturate(1.35);
  }
}

.online-panel {
  right: 18px;
  top: 18px;
  bottom: auto;
  width: min(470px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.appraisal-panel {
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  width: auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  background: rgba(18, 19, 26, 0.95);
}

.appraisal-panel header {
  margin-bottom: 0;
}

.equipment-storage-panel {
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  width: auto;
  max-height: none;
  overflow: hidden;
  background: rgba(18, 19, 26, 0.95);
}

.equipment-storage-panel header {
  margin-bottom: 0;
}

.storage-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 72px;
}

.storage-category-tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 72px;
  padding: 9px 11px;
  border-color: rgba(237, 246, 255, 0.16);
  background: rgba(237, 246, 255, 0.06);
  text-align: left;
}

.storage-category-tab.is-active {
  border-color: rgba(141, 232, 255, 0.72);
  background: linear-gradient(135deg, rgba(69, 198, 205, 0.26), rgba(237, 246, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(141, 232, 255, 0.22), 0 0 24px rgba(69, 198, 205, 0.14);
}

.storage-category-tab > span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--snow);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.storage-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.storage-controls label > span {
  color: rgba(141, 232, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.storage-controls select {
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(237, 246, 255, 0.16);
  border-radius: 7px;
  background: rgba(18, 19, 26, 0.92);
  color: var(--snow);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.storage-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.05);
}

.storage-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.storage-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.storage-list,
.storage-detail {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.storage-list {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-right: 2px;
}

.storage-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 10px;
  border-color: rgba(237, 246, 255, 0.14);
  text-align: left;
}

.storage-item[data-selected="true"] {
  border-color: rgba(141, 232, 255, 0.68);
  background: rgba(141, 232, 255, 0.16);
}

.storage-item[data-rarity="epic"] {
  border-color: rgba(198, 144, 255, 0.44);
}

.storage-item[data-rarity="legendary"] {
  border-color: rgba(211, 165, 74, 0.62);
}

.storage-item-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.storage-item strong,
.storage-item small,
.storage-item-flags {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-item strong {
  color: var(--snow);
  font-size: 14px;
}

.storage-item small,
.storage-item-flags {
  color: rgba(237, 246, 255, 0.66);
  font-size: 12px;
  font-weight: 800;
}

.storage-detail {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 13px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 8px;
  background: rgba(237, 246, 255, 0.06);
}

.storage-detail-header {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.storage-detail-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.storage-detail h3 {
  margin: 0;
  color: var(--snow);
  font-size: 21px;
  line-height: 1.25;
}

.storage-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.06);
  color: rgba(237, 246, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.storage-compare {
  display: grid;
  gap: 7px;
  padding: 9px;
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.08);
}

.storage-compare strong {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.storage-compare span {
  color: rgba(237, 246, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.storage-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0;
}

.equipment-icon-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 2px solid rgba(237, 246, 255, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 45% 36%, rgba(237, 246, 255, 0.24), rgba(69, 198, 205, 0.08) 45%, rgba(18, 19, 26, 0.42) 78%),
    rgba(18, 19, 26, 0.7);
  box-shadow: inset 0 0 0 1px rgba(18, 19, 26, 0.72);
  flex: 0 0 auto;
}

.equipment-icon-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  border: 1px solid rgba(237, 246, 255, 0.22);
  border-radius: 5px;
  pointer-events: none;
}

.equipment-icon-frame::after {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: 0;
  background: radial-gradient(circle at 30% 24%, rgba(237, 246, 255, 0.34), transparent 28%);
  opacity: 0.55;
  pointer-events: none;
}

.equipment-icon-glyph {
  position: relative;
  z-index: 2;
  width: 92%;
  height: 92%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.equipment-icon-frame[data-type="kunai"] .equipment-icon-glyph {
  background-image: url("../assets/runtime/ui/equipment_icon_kunai.png?v=20260602a");
}

.equipment-icon-frame[data-type="ring"] .equipment-icon-glyph {
  background-image: url("../assets/runtime/ui/equipment_icon_ring.png?v=20260602a");
}

.equipment-icon-frame[data-type="trap"] .equipment-icon-glyph {
  background-image: url("../assets/runtime/ui/equipment_icon_talisman.png?v=20260602a");
}

.equipment-icon-frame[data-type="charm"] .equipment-icon-glyph {
  background-image: url("../assets/runtime/ui/equipment_icon_charm.png?v=20260602a");
}

.equipment-icon-frame[data-rarity="common"] {
  border-color: rgba(237, 246, 255, 0.38);
}

.equipment-icon-frame[data-rarity="rare"] {
  border-color: rgba(141, 232, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(18, 19, 26, 0.72), 0 0 12px rgba(141, 232, 255, 0.16);
}

.equipment-icon-frame[data-rarity="epic"] {
  border-color: rgba(198, 144, 255, 0.82);
  background:
    radial-gradient(circle at 45% 36%, rgba(237, 246, 255, 0.24), rgba(198, 144, 255, 0.16) 45%, rgba(18, 19, 26, 0.42) 78%),
    rgba(18, 19, 26, 0.7);
  box-shadow: inset 0 0 0 1px rgba(198, 144, 255, 0.22), 0 0 14px rgba(198, 144, 255, 0.18);
}

.equipment-icon-frame[data-rarity="legendary"] {
  border-color: rgba(211, 165, 74, 0.92);
  background:
    radial-gradient(circle at 45% 36%, rgba(255, 245, 190, 0.34), rgba(211, 165, 74, 0.17) 46%, rgba(18, 19, 26, 0.4) 78%),
    rgba(18, 19, 26, 0.7);
  box-shadow: inset 0 0 0 2px rgba(255, 244, 181, 0.2), 0 0 18px rgba(211, 165, 74, 0.28);
}

.storage-tab-icon {
  width: 52px;
  height: 52px;
}

.storage-item-icon {
  width: 50px;
  height: 50px;
}

.storage-detail-icon {
  width: 74px;
  height: 74px;
}

@keyframes appraisal-card-reveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    filter: brightness(1.55);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes appraisal-row-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.appraisal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  min-width: 0;
  margin-bottom: 0;
}

.appraisal-summary span {
  min-width: 0;
  min-height: 36px;
  padding: 7px 6px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.06);
  color: rgba(237, 246, 255, 0.62);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.appraisal-summary span[data-active="true"] {
  border-color: rgba(211, 165, 74, 0.44);
  background: rgba(211, 165, 74, 0.16);
  color: var(--snow);
}

.appraisal-body {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.appraisal-empty {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.06);
  color: rgba(237, 246, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.appraisal-batch-summary {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(211, 165, 74, 0.36);
  border-radius: 8px;
  background: rgba(211, 165, 74, 0.12);
}

.appraisal-batch-summary strong {
  color: var(--snow);
  font-size: 16px;
  font-weight: 900;
}

.appraisal-batch-summary span {
  color: rgba(237, 246, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.appraisal-reveal-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.appraisal-reveal-card {
  display: grid;
  gap: 7px;
  min-height: 140px;
  padding: 13px;
  border: 1px solid rgba(141, 232, 255, 0.28);
  border-radius: 8px;
  background: rgba(141, 232, 255, 0.1);
  animation: appraisal-card-reveal 520ms both;
}

.appraisal-reveal-card[data-reveal="upgrade"],
.appraisal-reveal-card[data-reveal="unique"] {
  border-color: rgba(211, 165, 74, 0.72);
  background: linear-gradient(135deg, rgba(211, 165, 74, 0.24), rgba(141, 232, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(211, 165, 74, 0.18), 0 0 28px rgba(211, 165, 74, 0.12);
}

.appraisal-reveal-card[data-reveal="high"] {
  border-color: rgba(198, 144, 255, 0.58);
  background: rgba(198, 144, 255, 0.14);
}

.appraisal-reveal-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.appraisal-reveal-card strong {
  min-width: 0;
  color: var(--snow);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.appraisal-reveal-card small,
.appraisal-reveal-card p {
  margin: 0;
  color: rgba(237, 246, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.appraisal-result-title {
  margin: 2px 0 -2px;
  color: rgba(141, 232, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.appraisal-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.appraisal-result-list li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 72px;
  padding: 9px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.06);
  animation: appraisal-row-reveal 320ms both;
}

.appraisal-result-list li[data-reveal="upgrade"],
.appraisal-result-list li[data-reveal="unique"] {
  border-color: rgba(211, 165, 74, 0.44);
  background: rgba(211, 165, 74, 0.12);
}

.appraisal-result-list li[data-reveal="dust"] {
  opacity: 0.86;
}

.appraisal-result-badge {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  min-height: 24px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(18, 19, 26, 0.42);
  color: var(--ice);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.appraisal-result-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.appraisal-result-list strong,
.appraisal-result-list small,
.appraisal-result-list div > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.appraisal-result-list strong {
  color: var(--snow);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.appraisal-result-list small,
.appraisal-result-list div > span {
  color: rgba(237, 246, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.appraisal-panel.is-reveal-skipped .appraisal-reveal-card,
.appraisal-panel.is-reveal-skipped .appraisal-result-list li {
  animation-duration: 1ms;
  animation-delay: 0ms !important;
}

.equipment-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(237, 246, 255, 0.14);
  border-radius: 8px;
  background: rgba(237, 246, 255, 0.07);
}

.equipment-card[data-rarity="rare"] {
  border-color: rgba(141, 232, 255, 0.4);
}

.equipment-card[data-rarity="epic"] {
  border-color: rgba(198, 144, 255, 0.48);
}

.equipment-card[data-rarity="legendary"] {
  border-color: rgba(211, 165, 74, 0.62);
  background: rgba(211, 165, 74, 0.1);
}

.equipment-card header {
  margin-bottom: 0;
}

.equipment-card h3 {
  margin: 0;
  color: var(--snow);
  font-size: 18px;
  line-height: 1.25;
}

.equipment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.equipment-meta span {
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(18, 19, 26, 0.38);
  color: rgba(237, 246, 255, 0.68);
  font-size: 10px;
  font-weight: 900;
}

.affix-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.affix-list li {
  padding: 6px 7px;
  border-radius: 6px;
  background: rgba(18, 19, 26, 0.38);
  color: rgba(237, 246, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.unique-effect,
.synergy-list,
.absorb-summary,
.candidate-list {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(141, 232, 255, 0.1);
}

.absorb-summary {
  background: rgba(211, 165, 74, 0.14);
}

.candidate-list {
  background: rgba(198, 144, 255, 0.12);
}

.unique-effect strong,
.synergy-list strong,
.absorb-summary strong,
.candidate-list strong {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.unique-effect span,
.synergy-list span,
.absorb-summary span,
.candidate-list span {
  color: rgba(237, 246, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.appraisal-panel .panel-actions {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-self: end;
  gap: 10px;
  margin-top: 0;
}

.appraisal-panel .panel-actions button {
  min-width: 0;
  min-height: 42px;
}

.online-match-section {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.online-match-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(237, 246, 255, 0.14);
  border-radius: 8px;
  background: rgba(237, 246, 255, 0.06);
}

.online-match-card h3 {
  margin: 0;
  color: var(--snow);
  font-size: 15px;
  font-weight: 900;
}

.online-match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.45fr);
  gap: 9px;
  align-items: center;
}

.online-match-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.online-match-row strong {
  color: rgba(237, 246, 255, 0.92);
  font-size: 13px;
  font-weight: 900;
}

.online-match-row small,
.online-public-status,
.online-room-id-display small {
  min-width: 0;
  color: rgba(237, 246, 255, 0.68);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.online-room-id-display {
  display: grid;
  grid-template-columns: auto minmax(82px, 1fr) minmax(118px, auto);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(211, 165, 74, 0.28);
  border-radius: 7px;
  background: rgba(211, 165, 74, 0.11);
}

.online-room-id-display.is-empty {
  display: none;
}

.online-room-id-display span,
.online-code span,
.online-field span {
  color: rgba(141, 232, 255, 0.78);
  font-size: 11px;
  font-weight: 900;
}

.online-room-id-display strong {
  color: var(--gold);
  font: 900 18px ui-monospace, Consolas, monospace;
  line-height: 1;
}

.online-room-id-display small {
  grid-column: 1 / -1;
}

.online-copy-button {
  min-height: 30px;
  padding: 5px 8px;
  white-space: nowrap;
}

.online-public-status[data-state="available"] {
  color: var(--ice);
}

.online-public-join.is-pulsing {
  border-color: rgba(141, 232, 255, 0.82);
  animation: online-public-pulse 1.35s ease-in-out infinite;
}

@keyframes online-public-pulse {
  0%,
  100% {
    background: rgba(69, 198, 205, 0.24);
    box-shadow: 0 0 0 rgba(141, 232, 255, 0);
  }

  50% {
    background: rgba(69, 198, 205, 0.42);
    box-shadow: 0 0 18px rgba(141, 232, 255, 0.22);
  }
}

.online-debug-connect {
  margin: 10px 0;
  padding: 9px;
  border: 1px solid rgba(237, 246, 255, 0.12);
  border-radius: 8px;
  background: rgba(237, 246, 255, 0.04);
}

.online-debug-connect summary {
  cursor: pointer;
  color: rgba(237, 246, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.online-debug-connect[open] summary {
  margin-bottom: 9px;
}

.online-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.online-field,
.online-code {
  display: grid;
  gap: 5px;
}

.online-signal-settings {
  margin-bottom: 8px;
}

.online-code {
  margin-top: 8px;
}

.online-field input,
.online-code textarea {
  width: 100%;
  border: 1px solid rgba(237, 246, 255, 0.16);
  border-radius: 7px;
  background: rgba(237, 246, 255, 0.07);
  color: var(--snow);
  font: 700 11px ui-monospace, Consolas, monospace;
  line-height: 1.45;
}

.online-field input {
  min-height: 34px;
  padding: 7px 9px;
  text-transform: uppercase;
}

.online-signal-settings input {
  text-transform: none;
}

.online-code textarea {
  min-height: 72px;
  resize: vertical;
  word-break: break-all;
}

.online-field input:focus,
.online-code textarea:focus {
  outline: 2px solid rgba(141, 232, 255, 0.32);
  border-color: rgba(141, 232, 255, 0.7);
}

.result-panel dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.result-panel dl div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(237, 246, 255, 0.1);
}

.result-panel dt {
  color: rgba(141, 232, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.result-panel dd {
  margin: 0;
  color: var(--snow);
  font-size: 13px;
  font-weight: 800;
}

.is-hidden {
  display: none !important;
}

#boot-panel.is-hidden {
  display: grid !important;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-aspect-ratio: 4 / 3) {
  .boot-splash-bg {
    opacity: 0.86;
  }

  .boot-splash-image {
    box-sizing: border-box;
    padding: clamp(8px, 2.5vw, 18px);
    object-fit: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  #boot-panel {
    transition-duration: 80ms;
  }
}

@media (max-width: 1180px) {
  .prerun-hub-layout {
    grid-template-columns: minmax(220px, 0.82fr) minmax(360px, 1.18fr);
    overflow: auto;
  }

  .prerun-loadout-pane {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 760px) {
  .overlay-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 13px;
  }

  .prerun-hub {
    display: block;
    top: 8px;
    bottom: 8px;
    overflow: auto;
  }

  .prerun-hub > * + * {
    margin-top: 9px;
  }

  .prerun-hub-header {
    grid-template-columns: 1fr;
  }

  .prerun-hub-status {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    width: 100%;
  }

  .prerun-hub-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .prerun-character-pane,
  .prerun-preview-pane,
  .prerun-loadout-pane {
    overflow: visible;
  }

  .prerun-loadout-pane {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .prerun-character-preview {
    display: flex;
    flex-direction: column;
    min-height: 0;
    text-align: center;
  }

  .prerun-character-art {
    width: 136px;
  }

  .prerun-character-copy strong {
    font-size: 24px;
  }

  .prerun-character-traits,
  .prerun-equipment-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sortie-mode-list {
    grid-template-columns: 1fr;
  }

  .prerun-actions {
    grid-template-columns: 1fr;
  }

  .prerun-section-heading {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .queue-list {
    max-height: 34vh;
  }

  .character-list {
    grid-template-columns: 1fr;
    max-height: 32vh;
  }

  .sortie-mode-list,
  .story-episode-panel {
    grid-template-columns: 1fr;
  }

  .story-episode-rewards {
    max-width: none;
    text-align: left;
  }

  .prerun-loadout {
    grid-template-columns: 1fr;
  }

  .equipment-storage-panel {
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 8px;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 9px;
    max-height: none;
  }

  .storage-category-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    min-height: 0;
  }

  .storage-category-tab {
    min-height: 58px;
    padding: 6px 8px;
  }

  .storage-category-tab > span:last-child {
    font-size: 13px;
  }

  .storage-tab-icon {
    width: 40px;
    height: 40px;
  }

  .storage-controls {
    grid-template-columns: 1fr 1fr;
  }

  .storage-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 0.85fr) minmax(180px, 1.15fr);
    min-height: 0;
  }

  .storage-list,
  .storage-detail {
    max-height: none;
  }

  .storage-item {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 66px;
    padding: 8px;
  }

  .storage-item-icon {
    width: 44px;
    height: 44px;
  }

  .storage-detail-header {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .storage-detail-icon {
    width: 56px;
    height: 56px;
  }

  .storage-detail h3 {
    font-size: 17px;
  }

  .storage-actions {
    grid-template-columns: 1fr 1fr;
  }

  .appraisal-panel {
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 8px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 9px;
    max-height: none;
  }

  .appraisal-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .appraisal-summary span {
    min-height: 34px;
    white-space: normal;
  }

  .appraisal-body {
    gap: 8px;
    padding-right: 0;
  }

  .appraisal-reveal-strip {
    grid-template-columns: 1fr;
  }

  .appraisal-reveal-card {
    min-height: 118px;
    padding: 10px;
  }

  .appraisal-result-list {
    grid-template-columns: 1fr;
  }

  .appraisal-result-list li {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .appraisal-panel .panel-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .online-match-row,
  .online-room-id-display {
    grid-template-columns: 1fr;
  }

  .online-match-row button,
  .online-room-id-display button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .appraisal-reveal-card,
  .appraisal-result-list li,
  .online-public-join.is-pulsing {
    animation-duration: 1ms;
    animation-delay: 0ms !important;
  }

  .online-public-join.is-pulsing {
    box-shadow: none;
  }
}
