/* Header, focus display, footer and slot metadata */
.spell-slot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%; /* Ensure wrapper fills its grid cell so siblings remain equal */
  box-sizing: border-box;
}

.spell-slot {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0f2e 100%);
  border: 2px solid #4a9eff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(74, 158, 255, 0.1), inset 0 0 8px rgba(74, 158, 255, 0.05);
  width: 100%; /* Force slot to fill its wrapper/grid cell */
  height: 100%;
  padding: 0;
  box-sizing: border-box;
}

/* Visual treatment for slots that are inactive (0 Focus) */
.spell-slot.inactive-slot {
  /* Keep the slot container layout unchanged so the add-focus control can remain emphasized.
     Visual muting is applied to specific child elements below. */
  box-shadow: none;
  border-color: rgba(120, 120, 120, 0.35);
  background: linear-gradient(135deg, #070708 0%, #111018 100%);
}

/* Keep the add-focus control emphasized even when slot is inactive */
.spell-slot.inactive-slot .slot-add-focus {
  opacity: 1;
  box-shadow: 0 0 8px rgba(100, 200, 255, 0.18);
}

/* Disable/grey out the empty-slot button when slot is inactive */
.spell-slot.inactive-slot .spell-slot-empty-btn {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  color: #999;
  text-shadow: none;
  filter: grayscale(60%);
}

/* Slightly dim footer text for inactive slots */
.spell-slot.inactive-slot .spell-slot-footer .spell-slot-name {
  color: #9aa2b3;
  filter: grayscale(60%);
  opacity: 0.7;
}

.spell-slot:hover {
  border-color: #64c8ff;
  box-shadow: 0 0 20px rgba(100, 200, 255, 0.2);
}

/* Header for Focus Display and Add Focus Button */
.spell-slot-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.3);
  padding: 4px 6px;
  border-bottom: 1px solid rgba(74, 158, 255, 0.1);
}

.spell-slot-focus-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64c8ff;
  font-weight: 600;
}

/* Footer for Spell Name */
.spell-slot-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 6px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(74, 158, 255, 0.1);
}

.spell-slot-footer .spell-slot-name.inactive {
  color: #888;
}

.spell-slot-name {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-shadow: 1px 1px 2px black;
  color: #dff6ff;
  padding: 0 2px;
  background: transparent;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Ensure grid layout enforces equal widths on desktop */
@media (min-width: 769px) {
  .spell-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: stretch;
  }

  /* Make sure wrappers don't shrink or expand beyond grid cell */
  .spell-slot-wrapper {
    width: 100%;
    min-width: 0;
  }

  .spell-slot {
    min-width: 0;
  }
}