.ffm-item-3d-intro {
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
  text-align: left;
  padding: .75rem .35rem .1rem;
}

.ffm-item-3d-intro h2 {
  color: #ffc107;
  margin-bottom: .25rem;
}

.ffm-item-3d-intro p {
  color: #d9d9df;
}

.ffm-item-hero {
  overflow: hidden;
  border: 1px solid rgba(255, 193, 7, .24);
  background:
    linear-gradient(180deg, rgba(255, 193, 7, .08), rgba(0, 0, 0, 0) 34%),
    #050506 !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.ffm-item-showcase {
  margin: -.35rem;
}

.ffm-item-showcase-col {
  padding: .35rem;
}

.ffm-item-static-panel,
.ffm-item-3d-stage {
  position: relative;
  min-height: 350px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: .55rem;
  background:
    radial-gradient(circle at 50% 34%, rgba(64, 73, 91, .75) 0, rgba(18, 20, 27, .94) 54%, #08090d 100%);
  border: 1px solid rgba(255,255,255,.08);
}

.ffm-item-static-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ffm-item-static-panel.is-compact {
  min-height: 0;
  height: clamp(260px, 34vw, 420px);
  aspect-ratio: auto;
}

.ffm-item-static-panel img,
.ffm-item-3d-poster img {
  max-width: 74%;
  max-height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .55));
}

.ffm-item-static-panel.is-compact img {
  max-width: min(70%, 360px);
  max-height: min(76%, 320px);
}

.ffm-item-3d-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.25rem;
  border-radius: 999px;
  color: #061015;
  background: #00d8ff;
  font-size: .72rem;
  font-weight: 900;
}

.ffm-item-panel-label,
.ffm-item-3d-badge {
  position: absolute;
  top: .8rem;
  left: .8rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  color: #ffe066;
  background: rgba(0, 0, 0, .68);
  border: 1px solid rgba(255, 224, 102, .42);
  font-weight: 800;
  font-size: .9rem;
}

.ffm-item-3d {
  margin: 0;
}

.ffm-item-3d-poster,
.ffm-item-3d-loading,
.ffm-item-3d-stage model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ffm-item-3d-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: transparent;
}

.ffm-item-3d-poster:hover,
.ffm-item-3d-poster:focus {
  outline: none;
  background: rgba(255, 255, 255, .035);
}

.ffm-item-3d-action {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 4;
  max-width: calc(100% - 1.5rem);
  transform: translateX(-50%);
  padding: .48rem .9rem;
  border-radius: 999px;
  color: #111;
  background: #ffc107;
  white-space: nowrap;
  font-weight: 800;
  box-shadow: 0 .35rem .75rem rgba(0, 0, 0, .34);
}

.ffm-item-3d-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22);
  border-top-color: #ffc107;
  animation: ffm3dSpin .8s linear infinite;
}

@keyframes ffm3dSpin {
  to { transform: rotate(360deg); }
}

.ffm-item-3d-loading {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .65rem;
  background: rgba(0, 0, 0, .42);
  z-index: 3;
}

.ffm-item-3d.is-loading .ffm-item-3d-loading {
  display: flex;
}

.ffm-item-3d.is-loaded .ffm-item-3d-poster,
.ffm-item-3d.is-loaded .ffm-item-3d-loading {
  display: none;
}

.ffm-item-3d-stage model-viewer {
  --poster-color: transparent;
  z-index: 1;
}

.ffm-item-3d-debug {
  margin-top: .6rem;
  padding: .6rem .75rem;
  border-radius: .45rem;
  color: #d9e2f1;
  background: rgba(15, 23, 42, .86);
  border: 1px solid rgba(148, 163, 184, .35);
  font-size: .78rem;
  line-height: 1.35;
}

.ffm-item-3d-debug summary {
  cursor: pointer;
  color: #ffc107;
  font-weight: 800;
}

.ffm-item-3d-debug dl {
  margin: .55rem 0 0;
}

.ffm-item-3d-debug div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: .55rem;
  padding: .18rem 0;
}

.ffm-item-3d-debug dt {
  color: #93c5fd;
  font-weight: 800;
}

.ffm-item-3d-debug dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ffm-item-3d-stage.is-fullscreen-fallback {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  z-index: 10000;
}

.ffm-item-3d-stage.is-fullscreen-fallback::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #08090d;
}

.ffm-item-3d-stage.is-fullscreen-fallback model-viewer,
.ffm-item-3d-stage.is-fullscreen-fallback .ffm-item-3d-tools {
  position: fixed;
}

.ffm-item-3d-stage.is-fullscreen-fallback .ffm-item-3d-tools {
  right: .9rem;
  top: .9rem;
}

.ffm-item-3d-tools {
  position: absolute;
  right: .75rem;
  top: .75rem;
  z-index: 5;
  display: none;
  flex-direction: column;
  gap: .4rem;
}

.ffm-item-3d.is-loaded .ffm-item-3d-tools {
  display: flex;
}

.ffm-item-3d-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 216, 255, .65);
  border-radius: 999px;
  color: #eafcff;
  background: rgba(2, 17, 24, .9);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}

.ffm-item-3d-tools button:hover,
.ffm-item-3d-tools button:focus {
  outline: none;
  border-color: #ffc107;
  color: #ffc107;
  background: rgba(20, 18, 6, .96);
  transform: translateY(-1px);
}

.ffm-item-3d-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
}

.ffm-item-3d-switch {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: .55rem .9rem;
  color: #fff;
  background: #16181f;
  font-weight: 800;
  cursor: pointer;
}

.ffm-item-3d-switch.is-active {
  color: #111;
  background: #ffc107;
  border-color: #ffc107;
}

.ffm-item-3d-error {
  display: none;
  padding: .5rem 0 0;
  color: #ffb3b3;
  font-weight: 700;
  font-size: .9rem;
}

.ffm-item-3d.has-error .ffm-item-3d-error {
  display: block;
}

.ffm-item-summary {
  min-width: 0;
}

.ffm-item-summary h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  font-size: 2rem;
  line-height: 1.2;
}

.ffm-item-summary ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.ffm-item-summary li {
  margin-bottom: .55rem;
}

.ffm-item-title-3d-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  color: #051014;
  background: #00d8ff;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .ffm-item-static-panel,
  .ffm-item-3d-stage {
    min-height: 260px;
    aspect-ratio: 1 / 1;
  }

  .ffm-item-static-panel.is-compact {
    height: 260px;
  }

  /* No celular, mantém o texto explicativo entre a imagem e o visualizador 3D. */
  .ffm-item-showcase > .ffm-item-showcase-col:first-child {
    order: 1;
  }

  .ffm-item-3d-intro {
    order: 2;
    padding: .8rem .35rem .35rem;
  }

  .ffm-item-showcase > .ffm-item-showcase-col-3d {
    order: 3;
  }

  .ffm-item-3d-intro h2 {
    font-size: 1.05rem;
    line-height: 1.3;
  }

  .ffm-item-3d-intro p {
    font-size: .82rem;
    line-height: 1.55;
  }

  /* Evita a quebra de "Visualizar em 3D" em telas estreitas. */
  .ffm-item-3d-action {
    max-width: calc(100% - 1rem);
    padding: .44rem .68rem;
    font-size: .82rem;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
  }

  .ffm-item-3d-switch {
    padding: .48rem .72rem;
    font-size: .82rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .ffm-item-3d-badge,
  .ffm-item-panel-label {
    font-size: .82rem;
  }
}

.rarity-red { background: #e74c3c; color: #fff; }        /* Artefato */
.rarity-orange { background: #f39c12; color: #fff; }     /* Mítico */
.rarity-purple { background: #9b59b6; color: #fff; }     /* Épico */
.rarity-blue { background: #3498db; color: #fff; }       /* Raro */
.rarity-green { background: #2ecc71; color: #fff; }      /* Incomum */
.rarity-white { background: #bdc3c7; color: #000; }      /* Comum */
.rarity-none { background: #7f8c8d; color: #fff; }       /* Sem */

.item-data-block {
  margin: 18px 0;
}

.item-data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.item-data-grid div {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.item-data-grid strong,
.item-data-grid span {
  display: block;
}

.item-data-grid strong {
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}

.item-data-grid span {
  font-weight: 700;
  color: #222;
}

.item-search-block {
  margin: 18px 0;
}

.item-search-results {
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.item-search-results:empty {
  display: none;
}

@media (max-width: 768px) {
  .item-data-grid {
    grid-template-columns: 1fr 1fr;
  }
}
