/* Sprites — small looping characters built from Spellforge */

#panel-sprites.panel[hidden] {
  display: none !important;
}

#panel-sprites.panel.active {
  display: block;
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 4.5rem);
  background: #0c0e14;
}

/* The Spellforge vision is a full-page sheet at partial opacity. On Sprites it stays hidden, and the chrome stays solid. */
body.spr-tab-active #stasis-lure-root {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.spr-tab-active .site-header,
body.spr-tab-active .site-tabs {
  background: #0c0e14 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
}

body.spr-tab-active .site-tabs .tab {
  color: #f5f0e8 !important;
  text-shadow: none !important;
  opacity: 1;
}

body.spr-tab-active[data-stasis-skin-active] :is(
  .spellbook-panel,
  .spell-fusion-panel,
  .spell-slot,
  .spell-stasis-vision-wrap,
  .spell-loop-wrap
) {
  background: #161920 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  opacity: 1;
}

.spr-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.6rem 0.7rem 0.4rem;
  color: #ece6d6;
  background: #0c0e14;
}

.spr-forge {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0.7rem 2.5rem;
  background: #0c0e14;
}

.spr-forge .spellbook-panel {
  width: 100%;
}

.spr-shell h2 {
  margin: 0.2rem 0 0.3rem;
}

.spr-hint {
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  line-height: 1.4;
}

.spr-stage-wrap {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  flex-wrap: wrap;
  background: #10131a;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 10px;
  padding: 0.7rem;
}

.spr-frame {
  position: relative;
  width: 192px;
  height: 192px;
  flex: 0 0 auto;
  background: #12151e;
  overflow: hidden;
}

.spr-frame-mini {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(236, 230, 214, 0.15);
}

.spr-layers {
  position: absolute;
  inset: 0;
}

.spr-stage,
.spr-mini,
.spr-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  background: #12151e;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.spr-layer[hidden],
.spr-stage[hidden],
.spr-mini[hidden] {
  display: none !important;
}

.spr-stage-copy {
  flex: 1 1 180px;
  min-width: 0;
}

.spr-stage-copy p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}

.spr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0;
}

.spr-shell button {
  background: #1c1f2b;
  color: #f0d78a;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.spr-shell button:hover {
  background: #262a3a;
}

.spr-shell button:disabled {
  opacity: 0.5;
  cursor: default;
}

.spr-shell button.is-on,
.spr-shell button.spr-primary {
  background: #c9a227;
  color: #14120c;
  font-weight: 700;
}

.spr-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
  margin: 0.8rem 0 0.3rem;
}

.spr-spells {
  display: grid;
  gap: 0.35rem;
}

.spr-spell {
  background: #0e1017;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

.spr-spell b {
  color: #f0d78a;
}

.spr-status {
  min-height: 1.2em;
  margin: 0.4rem 0;
  font-size: 0.85rem;
  color: #8fd0ea;
}

.spr-status.is-error {
  color: #ff9c8a;
}

.spr-playfield {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 16rem;
  gap: 0.7rem;
  align-items: start;
  margin-top: 0.35rem;
}

.spr-side {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.spr-send {
  width: 72px;
  height: 72px;
  box-sizing: border-box;
  padding: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #1c1f2b;
  border: 1px solid rgba(230, 211, 161, 0.7);
  position: relative;
}

.spr-send-icon {
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid #f0e2c0;
  margin-left: 4px;
}

.spr-send::after {
  content: "→";
  position: absolute;
  right: -0.85rem;
  color: #f0e2c0;
  font-size: 1.3rem;
}

.spr-game {
  min-width: 0;
  background: #0c0e14;
  border: 2px solid #e6d3a1;
  border-radius: 18px 26px 16px 22px;
  padding: 0.35rem 0.55rem 0.7rem;
  position: relative;
  z-index: 1;
}

.spr-game h3 {
  margin: 0.1rem 0 0.25rem;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 2.2rem;
  letter-spacing: 0.02em;
  color: #f0e2c0;
}

.spr-game-stage {
  position: relative;
}

#spr-game-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #12151e;
  image-rendering: pixelated;
  touch-action: none;
}

.spr-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
  color: #f0e2c0;
  font-size: 0.85rem;
}

.spr-shell button.spr-picture {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #12151e;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.spr-picture[hidden] {
  display: none !important;
}

.spr-picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  image-rendering: pixelated;
  background: #12151e;
}

.spr-picture:not(.has-picture) img {
  visibility: hidden;
}

.spr-stats {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.spr-stats li {
  margin: 0;
  color: #ece6d6;
  font-size: 0.78rem;
  line-height: 1.35;
}

.spr-stats li:nth-child(1) { color: #f0d78a; }
.spr-stats li:nth-child(2) { color: #8fd0ea; }
.spr-stats li:nth-child(3) { color: #d7c4a3; }
.spr-stats li:nth-child(4) { color: #d46a6a; }
.spr-stats li:nth-child(5) { color: #c9a227; }

.spr-picture-stage {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #000;
}

.spr-picture-stage[hidden] {
  display: none !important;
}

.spr-picture-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

body.spr-picture-open {
  overflow: hidden;
}

.spr-game-note {
  margin: 0.35rem 0 0;
  color: #ece6d6;
  font-size: 0.82rem;
}

.spr-key-mode {
  margin: 0.45rem 0 0;
  color: #8fd0ea;
  font-size: 0.8rem;
}

.spr-prompt {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.35rem;
}

.spr-prompt label {
  color: #f0e2c0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spr-prompt input {
  flex: 1;
  min-width: 0;
  background: #12151e;
  color: #f0e2c0;
  border: 1px solid rgba(230, 211, 161, 0.45);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.88rem;
}

.spr-prompt.is-typing input {
  border-color: #f0e2c0;
  box-shadow: 0 0 0 2px rgba(240, 226, 192, 0.35);
}

.spr-moves,
.spr-entities-note {
  margin: 0.35rem 0 0;
  color: #ece6d6;
  font-size: 0.8rem;
  line-height: 1.35;
}

.spr-entities h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: #f0e2c0;
}

.spr-entities {
  min-width: 0;
  background: #0c0e14;
  border: 1px solid rgba(230, 211, 161, 0.45);
  border-radius: 12px;
  padding: 0.45rem 0.5rem 0.6rem;
}

.spr-entities-note {
  margin-top: 0.2rem;
}

#spr-save-entity,
#spr-save-enemy,
#spr-save-projectile {
  width: 100%;
  margin: 0.35rem 0;
}

.spr-entity-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 11rem;
  overflow: auto;
}

.spr-entity-empty {
  margin: 0.2rem 0 0;
  color: #8fd0ea;
  font-size: 0.78rem;
}

.spr-entity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  text-align: left;
}

.spr-entity img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #12151e;
}

.spr-entity-name,
.spr-entity-moves {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spr-entity-moves {
  font-size: 0.72rem;
  font-weight: 500;
}

.spr-entity-drop {
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}

.spr-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.spr-keys button {
  flex: 1 1 16rem;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
  font-size: 0.75rem;
}

.spr-level {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem;
  background: rgba(12, 14, 20, 0.92);
  overflow: auto;
}

.spr-level[hidden] {
  display: none !important;
}

.spr-level p {
  margin: 0;
  text-align: center;
  color: #f0e2c0;
}

.spr-level button {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 0.3rem;
  white-space: normal;
  line-height: 1.35;
  font-size: 0.82rem;
}

@media (max-width: 540px) {
  .spr-frame {
    width: 128px;
    height: 128px;
  }

  .spr-frame-mini {
    width: 64px;
    height: 64px;
  }

  .spr-playfield {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .spr-side {
    width: 100%;
  }

  #spr-game-canvas {
    max-width: 100%;
  }

  .spr-game h3 {
    font-size: 1.8rem;
  }
}
