#trainingRoom {
  --accent: #ff8a3d;
  position: fixed;
  inset: 0;
  margin: 0 auto;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #171c25;
  color: #fff2d3;
  font: 600 1rem Georgia, 'Songti SC', serif;
}
@media (min-width: 600px) { #trainingRoom { width: min(100vw, 70dvh); } }
#trainingRoom::backdrop { background: #10131c; }
#trainingRoom [hidden] { display: none !important; }
.tr-stage { position: relative; height: 100%; min-height: 570px; isolation: isolate; }
.tr-art { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
#trainingRoom button { cursor: pointer; font: inherit; color: inherit; touch-action: manipulation; }
#trainingRoom button:disabled { cursor: default; }
#trainingRoom button:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.tr-back, .tr-help, .tr-plus, .tr-tier, .tr-type { position: absolute; background: transparent; border: 0; padding: 0; }
.tr-back { left: 2%; top: 0; width: 12%; min-width: 44px; height: 8%; }
.tr-help { left: 27%; top: 0; width: 10%; min-width: 40px; height: 8%; }
.tr-plus { top: 0; height: 8%; width: 8%; min-width: 36px; }
.tr-plus[data-type=spirit] { left: 68.5%; }
.tr-plus[data-type=cultivation] { right: 1%; }
.tr-tip { position: absolute; z-index: 2; left: 6%; right: 6%; top: 8%; padding: 10px; margin: 0; background: #172031f5; border: 1px solid #cfa568; border-radius: 7px; font-size: .86rem; }
.tr-stock, .tr-value {
  position: absolute; display: grid; place-items: center; text-align: center;
  color: #fff3d4; font-variant-numeric: tabular-nums; line-height: 1.05;
  pointer-events: none; overflow: hidden;
}
.tr-stock { top: 2.65%; height: 3%; width: 11%; background: #202330; border-radius: 4px; font-size: .75rem; }
.tr-stock.s { left: 60.6%; }
.tr-stock.c { left: 82.4%; }
.tr-tier { top: 68%; height: 14%; width: 24%; border-radius: 8px; }
.tr-tier[data-tier=novice] { left: 7.3%; }
.tr-tier[data-tier=normal] { left: 38.1%; }
.tr-tier[data-tier=elder] { left: 69%; }
.tr-tier[aria-pressed=false] { background: #12172832; }
.tr-tier[data-tier=novice][aria-pressed=false] { backdrop-filter: brightness(.65); }
.tr-tier[aria-pressed=true], .tr-type[aria-pressed=true] { box-shadow: 0 0 0 2px #ffd68c, 0 0 10px var(--accent); }
.tr-rate { position: absolute; top: 100%; left: 0; width: 100%; line-height: 1.25; font-size: .72rem; text-shadow: 0 1px 4px #000; white-space: nowrap; }
.tr-type { top: 85.6%; width: 20%; height: 12.3%; border-radius: 8px; }
.tr-type[data-type=spirit] { left: 8%; }
.tr-type[data-type=cultivation] { right: 8%; }
.tr-value { bottom: .3%; left: 5%; width: 90%; min-height: 21%; border-radius: 4px; background: #384458; font-size: .8rem; }
#trainingRoom .tr-action {
  position: absolute; left: 30%; bottom: 4.1%; width: 40%; min-height: 44px;
  border: 1px solid #ffd791; background: #51372a; border-radius: 7px;
  box-shadow: 0 2px 8px #111826ad, inset 0 0 8px #ffba574b; font-size: .89rem;
}
#trainingRoom .tr-action:active:not(:disabled) { background: #745139; }
#trainingRoom .tr-action:disabled { background: #202937; border-color: #9f927e; }
.tr-info { position: absolute; left: 5%; right: 5%; bottom: 35%; text-align: center; padding: 5px 4px; border-block: 1px solid #cfa56888; background: #172031ed; font-size: .86rem; }
.tr-info small { display: block; color: #f2d39c; font-size: .73rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.tr-hit { display: none; position: absolute; left: 41%; top: 36%; width: 18%; height: 3px; border-radius: 50%; background: #ffdeb0; box-shadow: 0 0 9px var(--accent); pointer-events: none; }
#trainingRoom.running .tr-hit { display: block; animation: tr-strike 1.6s infinite; }
@keyframes tr-strike {
  0%, 79%, 100% { opacity: 0; transform: translate(-30%, 50%) rotate(-38deg) scaleX(.1); }
  85% { opacity: 1; transform: rotate(-38deg) scaleX(1.35); }
  94% { opacity: 0; transform: translate(30%, -50%) rotate(-38deg); }
}
@media (prefers-reduced-motion: reduce) { #trainingRoom.running .tr-hit { display: none; } }
.xiu-view .sm-map > .tr-node {
  position: absolute; z-index: 2; left: 23%; top: 11%; transform: translate(-50%, -50%);
  width: min(39%, 126px); min-height: 44px; padding: 4px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  background: #483328; color: #ffe6b0; border: 2px solid #c69e66; border-radius: 8px;
  font-size: .9rem; font-weight: bold;
}
.tr-node .tr-node-icon { width: 24px; height: 30px; flex: none; border-radius: 4px; background: url('images/gen/gptimg_1796125144_look.jpg') 53% 39% / 360% 290%; }
.resource-row .tr-spirit { color: #8cdfff; }

/* Match the fifth node to the existing thumbnail cards without moving them. */
.xiu-view .sm-map > .tr-node {
  top: 13%; box-sizing: border-box; width: min(39%,126px); flex-direction: column; gap: 2px;
  padding: 5px; background: #4a3a2ff2; color: #ffe7b7; border-color: #d9a564;
  border-radius: 12px; box-shadow: 0 6px 14px #3a24124d; line-height: 1.25;
}
.tr-node .tr-node-icon { width: 100%; height: 29px; border-radius: 7px; background-size: 100% auto; background-position: 50% 43%; }
.xiu-view:has(.sm-map) { overflow-x: hidden; }
